Skip to main content

The Folder service exposes all the operations available around FOLDER type components.

Folder retrieval

The examples below show how to retrieve folders from a list of identifiers.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> list of folder identifiers to be retrieved
curl -X GET "<CORE_HOST>/rest/folders/<IDS>" \
-H "token: <TOKEN>"

Folder creation

The examples below show how to create a list of folders.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
curl -X POST "<CORE_HOST>/rest/folders" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"category": "FOLDER",
"data": {
"ACL": "acl-folder",
"classId": "FolderClass",
"owner": "jna"
},
"name": "My Folder",
"tags": [
{
"name": "FolderRef",
"readOnly": false,
"value": [
"REF-001"
]
},
{
"name": "Description",
"readOnly": false,
"value": [
"Sample folder"
]
}
]
}
]'

Folder modification

This operation updates the data in a folder: tags and data (class identifier, ACL, owner, etc.).

info

This service operates on a cancel and replace basis, so all tag values must be supplied by the service at the time of update. It is therefore advisable to retrieve the folder, make the changes and call the update service.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> list of folder identifiers to be updated
curl -X POST "<CORE_HOST>/rest/folders/<IDS>" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"category": "FOLDER",
"data": {
"ACL": "acl-folder",
"classId": "FolderClass",
"owner": "jna"
},
"name": "My Updated Folder",
"tags": [
{
"name": "FolderRef",
"readOnly": false,
"value": [
"REF-001"
]
},
{
"name": "Description",
"readOnly": false,
"value": [
"Updated description"
]
}
]
}
]'

Folder search

The search operations all work on the same model as described here.

Folder deletion

The examples below show how to delete a list of folders from a list of identifiers.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> list of folder identifiers to be deleted
curl -X DELETE "<CORE_HOST>/rest/folders/<IDS>" \
-H "token: <TOKEN>"

Managing children

Folders can contain children (documents, tasks, or other folders). The following operations allow managing the children of a folder.

Adding children

This operation adds children to a folder without removing existing ones.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <ID> folder identifier
curl -X PUT "<CORE_HOST>/rest/folders/<ID>/children" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"id": "documentId1",
"category": "DOCUMENT"
},
{
"id": "taskId1",
"category": "TASK"
}
]'

Replacing children

This operation replaces all existing children with the provided list.

warning

This operation removes all existing children before adding the new ones. Make sure to include all desired children in the request.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <ID> folder identifier
curl -X POST "<CORE_HOST>/rest/folders/<ID>/children" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"id": "documentId1",
"category": "DOCUMENT"
},
{
"id": "documentId2",
"category": "DOCUMENT"
}
]'

Removing children

This operation removes specific children from a folder.

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <ID> folder identifier
curl -X DELETE "<CORE_HOST>/rest/folders/<ID>/children" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"id": "documentId1",
"category": "DOCUMENT"
}
]'