Allow to modify the annotations stored at the preview level. Modifications are applied via three fields, additions to give all the annotations that need to be added, updates that list annotations that needs to be modified, and deletions to list the IDs of annotations that needs to be removed.
PUT
/actions/preview-files/{preview_file_id}/update-annotations
curl
curl -X PUT "http://api.example.com/actions/preview-files/a24a6ea4-ce75-4665-a070-57453082c25/update-annotations" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"additions": [
{
"type": "drawing",
"x": 100,
"y": 200
}
],
"updates": [
{
"id": "uuid",
"x": 150,
"y": 250
}
],
"deletions": [
"a24a6ea4-ce75-4665-a070-57453082c25"
]
}'
import requests
url = "http://api.example.com/actions/preview-files/a24a6ea4-ce75-4665-a070-57453082c25/update-annotations"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"additions": [
{
"type": "drawing",
"x": 100,
"y": 200
}
],
"updates": [
{
"id": "uuid",
"x": 150,
"y": 250
}
],
"deletions": [
"a24a6ea4-ce75-4665-a070-57453082c25"
]
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
curl \
--request PUT 'http://api.example.com/actions/preview-files/a24a6ea4-ce75-4665-a070-57453082c25/update-annotations' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"additions":[{"x":100,"y":200,"type":"drawing"}],"updates":[{"x":150,"y":250,"id":"uuid"}],"deletions":["a24a6ea4-ce75-4665-a070-57453082c25"]}'
Request examples
{
"additions": [
{
"x": 100,
"y": 200,
"type": "drawing"
}
],
"updates": [
{
"x": 150,
"y": 250,
"id": "uuid"
}
],
"deletions": [
"a24a6ea4-ce75-4665-a070-57453082c25"
]
}
Response examples (200)
{
"id": "a24a6ea4-ce75-4665-a070-57453082c25",
"annotations": [
{}
]
}