cURL
curl --request GET \
--url https://davinci-app.com/api/v2/programmatic/projects/{projectId}/files \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
files = client.projects.list_files("project-id", branch="main")
for file in files:
print(file.id, file.name)import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const files = await client.projects.listFiles('project-id', { branch: 'main' });
for (const file of files) {
console.log(file.id, file.name);
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/programmatic/projects/{projectId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"files": [
{
"id": "<string>",
"name": "<string>",
"parent": "<string>",
"fileType": "<string>",
"filename": "<string>"
}
],
"count": 1
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Projects
List files attached to a project
Files are derived from project reference objects.
GET
https://davinci-app.com
/
api
/
v2
/
programmatic
/
projects
/
{projectId}
/
files
cURL
curl --request GET \
--url https://davinci-app.com/api/v2/programmatic/projects/{projectId}/files \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
files = client.projects.list_files("project-id", branch="main")
for file in files:
print(file.id, file.name)import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const files = await client.projects.listFiles('project-id', { branch: 'main' });
for (const file of files) {
console.log(file.id, file.name);
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/programmatic/projects/{projectId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"files": [
{
"id": "<string>",
"name": "<string>",
"parent": "<string>",
"fileType": "<string>",
"filename": "<string>"
}
],
"count": 1
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Personal access token. Programmatic reads require the projects:read scope.
Path Parameters
Project id. May be compound in the form {projectId}--{branchName}.
Minimum string length:
1Query Parameters
Response
Project files.
⌘I