curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/tree \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.content.get_tree(project_id)
for node in result.tree:
print(node.type, node.name)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { tree } = await client.content.getTree(projectId);
for (const node of tree) {
console.log(node.type, node.name);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"objectCount": 1,
"tree": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"parent": "<string>",
"childrenCount": 1
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Read the object tree
Returns every object in the project as a flat list, with parentage expressed
by parent and childrenCount.
This reads the running project, so it opens it if it is not already open, and it shows uncommitted state — which is the state a caller that just wrote something is asking about. The storage-backed reads are cheaper but only show the last save.
curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/tree \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
result = client.content.get_tree(project_id)
for node in result.tree:
print(node.type, node.name)
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const { tree } = await client.content.getTree(projectId);
for (const node of tree) {
console.log(node.type, node.name);
}
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"objectCount": 1,
"tree": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"parent": "<string>",
"childrenCount": 1
}
]
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Personal access token. The scopes granted at issuance determine both which
operations the key may call and the ceiling on the resource permissions it
can exercise. Each scope family is a ladder: projects:manage implies
projects:write and projects:read; cards:manage implies cards:write
and cards:read; and teams:manage implies teams:write and teams:read.
These are named API capability bundles, not blanket domain roles:
manage exposes only the permissions enumerated for that scope and never
bypasses the acting user's current role-based access.
Path Parameters
Project id. May be compound in the form {projectId}--{branchName}.
1Query Parameters
Response
The project's objects.
Flat list of project objects excluding the project object itself. New
projects contain reserved Model and Library packages whose parent
is the project id; callers must not assume a parentless node exists.
Total objects in the project, including the project object itself.
x >= 0