Move a canvas draft
import requests
url = "https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft"
payload = {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
base_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"current_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Canvases
Move a canvas draft
Undo and redo: points the draft at any revision of the canvas without writing a new one, under the same base_revision_id check as saving. Only the owner can move the draft.
POST
/
api
/
v1
/
org
/
canvases
/
{canvas_id}
/
draft
Move a canvas draft
import requests
url = "https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft"
payload = {
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
base_revision_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/canvases/{canvas_id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "dashboard",
"title": "<string>",
"visibility": "private",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_owner": true,
"is_pinned": true,
"language": "json",
"draft_revision_id": "<string>",
"published_revision_id": "<string>",
"source_conversation_id": "<string>",
"source_artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": 2,
"parent_revision_id": "<string>",
"language": "json",
"schema_version": 1,
"size_bytes": 123,
"author_kind": "user",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"reason": "<string>",
"code": "<string>",
"message": "<string>",
"current_revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Successful Response
A canvas with its draft revision.
Available options:
dashboard, page Available options:
private, organisation Whether the caller pinned the canvas.
The language of the draft revision.
Available options:
json, html, svg, markdown Show child attributes
Show child attributes