Skip to main content

The Delegations service exhibits all available operations around delegations.

Retrieving delegations

The examples below show how to retrieve delegations using the various get operations:

Retrieval by identifier

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> identifiers of the delegations to retrieve, separated by commas

curl -X GET "<CORE_HOST>/rest/delegation/<IDS>" \
-H "token: <TOKEN>"

Retrieval by delegate

# <CORE_HOST>           FlowerDocs Core base URL
# <TOKEN> authentication token
# <USER_ID> identifier of the user the delegation was given to
# <INCLUDE_TERMINATED> boolean

curl -X GET "<CORE_HOST>/rest/delegation/delegate/<USER_ID>?includeTerminated=<INCLUDE_TERMINATED>" \
-H "token: <TOKEN>"

Retrieval by delegator

# <CORE_HOST>           FlowerDocs Core base URL
# <TOKEN> authentication token
# <USER_ID> identifier of the user who gave the delegation
# <INCLUDE_TERMINATED> boolean

curl -X GET "<CORE_HOST>/rest/delegation/delegator/<USER_ID>?includeTerminated=<INCLUDE_TERMINATED>" \
-H "token: <TOKEN>"

Creating delegations

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token

curl -X POST "<CORE_HOST>/rest/delegation" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"creationDate": "2024-04-07 13:59:53.401 +0100",
"creator": "jna",
"delegate": "phu",
"delegator": "jna",
"description": "test création délégation",
"end": "2024-04-09 13:59:53.401 +0100",
"start": "2024-04-07 13:59:53.401 +0100"
}
]'

Updating delegations

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> identifiers of the delegations to update, separated by commas

curl -X POST "<CORE_HOST>/rest/delegation/<IDS>" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"creationDate": "2024-04-07 13:59:53.401 +0100",
"creator": "jna",
"delegate": "nca",
"delegator": "jna",
"description": "delegation jna to nca",
"end": "2024-04-09 13:59:53.401 +0100",
"start": "2024-04-07 13:59:53.401 +0100"
}
]'
warning

When using the REST service, unset fields will be cleared: you must send the entire delegation object, not just the fields to modify.

Deleting delegations

# <CORE_HOST>  FlowerDocs Core base URL
# <TOKEN> authentication token
# <IDS> identifiers of the delegations to delete, separated by commas

curl -X DELETE "<CORE_HOST>/rest/delegation/<IDS>" \
-H "token: <TOKEN>"