Skip to main content

The Annotation service exhibits all the operations available around a document annotations.

Annotations recovery

The examples below show how to retrieve annotations using the various operations of get.

All annotations recovery

# <CORE_HOST>    FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document where are the annotations to retrieve
curl -X GET "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations" \
-H "token: <TOKEN>"

Annotation creation

From a json

# <CORE_HOST>    FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document on which to create annotations
curl -X POST "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"color": {
"b": 0,
"g": 0,
"r": 0
},
"creationdate": "2025-08-25T12:21:18.497Z",
"date": "2025-08-25T12:21:18.497Z",
"document-id": {
"id": "documentId"
},
"flags": {
"hidden": false,
"invisible": false,
"locked": false,
"norotate": false,
"noview": false,
"nozoom": false,
"obfuscate": false,
"print": false,
"readonly": false,
"togglenoview": false
},
"last-modifier": "string",
"name": {
"id": "string"
},
"opacity": 0,
"page": 0,
"rect": {
"h": 0,
"w": 0,
"x": 0,
"y": 0
},
"type": "com.arondor.viewer.annotation.api.CircleElemType",
"title": "annotationTest"
}
]'

From xml

# <CORE_HOST>    FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document on which to create annotations
curl -X POST "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations" \
-H "token: <TOKEN>" \
-H "Content-Type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8"?>
<ns0:xfdf xmlns:ns0="http://ns.adobe.com/xfdf/"><ns0:annots>
<ns0:circle color="#EAF39C" flags="" name="cfdbee9c-dce1-4e62-bc10-55ab1554476b" page="0" rect="82.02787,218.50267,183.40193,337.67523" title="Unknown" creationdate="D:20221228084701+00'\''00'\''" opacity="0.7" fringe="0.0,0.0,0.0,0.0" interior-color="#EAF39C" width="0.0" style="solid" intensity=""/>
</ns0:annots>
</ns0:xfdf>'

Annotation modification

# <CORE_HOST>       FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document where are the annotations to update
# <ANNOTATION_IDS> identifiers of annotations to update
curl -X POST "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations/<ANNOTATION_IDS>" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"color": {
"b": 0,
"g": 0,
"r": 0
},
"creationdate": "2025-08-25T12:21:18.497Z",
"date": "2025-08-25T12:21:18.497Z",
"document-id": {
"id": "documentId"
},
"flags": {
"hidden": false,
"invisible": false,
"locked": false,
"norotate": false,
"noview": false,
"nozoom": false,
"obfuscate": false,
"print": false,
"readonly": false,
"togglenoview": false
},
"last-modifier": "string",
"name": {
"id": "string"
},
"opacity": 0,
"page": 0,
"rect": {
"h": 0,
"w": 0,
"x": 0,
"y": 0
},
"type": "com.arondor.viewer.annotation.api.FreetextElemType.FreetextElemType",
"title": "annotationTest"
}
]'

Annotation deletion

The examples below show how to delete annotations.

Part of annotations deletion

This operation allows to delete some of the annotations of a document

# <CORE_HOST>       FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document where are the annotations to delete
# <ANNOTATION_IDS> identifiers of annotations to delete
curl -X DELETE "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations/<ANNOTATION_IDS>" \
-H "token: <TOKEN>"

All annotations deletion

This operation allows to delete all the annotations of a document.

# <CORE_HOST>    FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> identifier of the document where are the annotations to delete
curl -X DELETE "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/annotations/allAnnotations" \
-H "token: <TOKEN>"