Skip to main content

The VersionService service displays the following operations:

  • promote: to create a version of a document
  • getVersions: to retrieve document versions
  • revert: to restore a version of a document
  • deleteVersion: to delete a version of a document
  • deleteVersions: to delete all versions of a document

Creating a version

The example below shows how to create a version of a document.


# <CORE_HOST>     FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> document identifier
# <LABEL> version name

curl -X POST "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/versions" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '"<LABEL>"'

Versions recovery

The example below shows how to recover versions of a document.


# <CORE_HOST>     FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> document identifier

curl -X GET "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/versions" \
-H "token: <TOKEN>"

Restoring a version

The example below shows how to restore a version of a document.


# <CORE_HOST>     FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> document identifier
# <VERSION_ID> document version identifier

curl -X POST "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/versions/<VERSION_ID>/revert" \
-H "token: <TOKEN>"

Version deletion

Deleting a version

The example below shows how to delete a version of a document.


# <CORE_HOST>     FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> document identifier
# <VERSION_ID> document version identifier

curl -X DELETE "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/versions/<VERSION_ID>" \
-H "token: <TOKEN>"

All versions deletion

The example below shows how to delete all versions of a document.


# <CORE_HOST>     FlowerDocs Core base URL
# <TOKEN> authentication token
# <DOCUMENT_ID> document identifier

curl -X DELETE "<CORE_HOST>/rest/documents/<DOCUMENT_ID>/versions" \
-H "token: <TOKEN>"