curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/changes \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
changes = client.branches.get_changes(project_id, "main")
print(changes.has_changes, len(changes.added))
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const changes = await client.branches.getChanges(projectId, 'main');
console.log(changes.hasChanges, changes.added.length);
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/changes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"hasChanges": true,
"totalObjectChanges": 1,
"added": [
"<string>"
],
"modified": [
"<string>"
],
"deleted": [
"<string>"
],
"deletedObjects": [
{
"objectId": "<string>",
"name": "<string>",
"type": "<string>",
"parentId": "<string>"
}
],
"committedHash": "<string>"
}{
"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": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Read uncommitted changes
Returns which objects on the branch differ from its last commit, as three lists of ids plus enough metadata to name the deleted ones.
Deleted objects come with their name and type because they can no longer be read from the project.
curl --request GET \
--url https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/changes \
--header 'Authorization: Bearer <token>'import os
from davinci_sdk import DavinciClient
with DavinciClient(api_key=os.environ["DAVINCI_API_KEY"]) as client:
changes = client.branches.get_changes(project_id, "main")
print(changes.has_changes, len(changes.added))
import { DavinciClient } from '@celedon/davinci-sdk';
const client = new DavinciClient({
apiKey: process.env.DAVINCI_API_KEY!,
});
const changes = await client.branches.getChanges(projectId, 'main');
console.log(changes.hasChanges, changes.added.length);
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://davinci-app.com/api/v2/projects/{projectId}/branches/{branch}/changes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"hasChanges": true,
"totalObjectChanges": 1,
"added": [
"<string>"
],
"modified": [
"<string>"
],
"deleted": [
"<string>"
],
"deletedObjects": [
{
"objectId": "<string>",
"name": "<string>",
"type": "<string>",
"parentId": "<string>"
}
],
"committedHash": "<string>"
}{
"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": {}
}
}{
"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}.
1Branch name.
1Response
Uncommitted changes.
Uncommitted changes on a branch, as object ids. One shape regardless of whether the branch is loaded — the answer comes from memory when it is and from a git diff when it is not, and the difference is not published.
x >= 0Commit the changes are measured against.