Skip to main content

The Task service exposes all the operations available around TASK type components.

Task recovery

The examples below show how to retrieve tasks from an ID list.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
# <IDS>: identifier of the documents to be retrieved
curl -X GET "<CORE_HOST>/rest/tasks/<IDS>" \
-H "token: <TOKEN>"

Task creation

The examples below show how to create a to-do list using the following operation.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
curl -X POST "<CORE_HOST>/rest/tasks/" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"workflow": "Inform",
"assignee": "fadmin",
"category": "TASK",
"data": {
"classId": "GEC_Step3_CourrierLu",
"owner": "clm",
"ACL": "ACL_TASK"
},
"name": "3-Courrier lu",
"tags": [
{
"value": [
"Jean"
],
"name": "PrenomClient",
"readOnly": false
},
{
"value": [
"123456"
],
"name": "RefClient",
"readOnly": false
},
{
"value": [
"DUPONT"
],
"name": "NomClient",
"readOnly": false
}
],
"attachments": [
{
"componentIds": [
"c46de78c-92d4-45ef-b262-8395aa76a4a8"
],
"id": "Courrier",
"category": "DOCUMENT",
"order": 0
}
]
}
]'

Task modification

This operation updates a task's tags and data (class identifier, task name, ACL, 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 recover the job, make the changes and call the update service.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
# <IDS>: identifiers of tasks to be updated
curl -X POST "<CORE_HOST>/rest/tasks/<IDS>" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '[
{
"workflow": "Inform",
"assignee": "fadmin",
"category": "TASK",
"data": {
"classId": "GEC_Step3_CourrierLu",
"owner": "clm",
"ACL": "ACL_TASK"
},
"name": "3-Courrier lu",
"tags": [
{
"value": [
"Jean"
],
"name": "PrenomClient",
"readOnly": false
},
{
"value": [
"123456"
],
"name": "RefClient",
"readOnly": false
},
{
"value": [
"DUPONT"
],
"name": "NomClient",
"readOnly": false
}
],
"attachments": [
{
"componentIds": [
"c46de78c-92d4-45ef-b262-8395aa76a4a8"
],
"id": "Courrier",
"category": "DOCUMENT",
"order": 0
}
]
}
]'

Job search

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

Task deletion

The examples below show how to delete a to-do list from an ID list.

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

Application of an answer

Simple answer

The examples below show how to apply a simple answer to a list of tasks from a list of identifiers.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
# <IDS>: task identifiers on which to apply the response
curl -X PUT "<CORE_HOST>/rest/tasks/<IDS>/answer" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"id": "Decline"
}'

Answer with reason

The examples below show how to retrieve tasks from an ID list.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
# <IDS>: task identifiers on which to apply the response
curl -X PUT "<CORE_HOST>/rest/tasks/<IDS>/answer" \
-H "token: <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"id": "Decline",
"type": "com.flower.docs.domain.taskclass.ReasonedAnswer",
"tags": [
{
"name": "Remark",
"value": [
"The receipt is not up to date."
]
}
]
}'

Task assignment

The examples below show how to assign a task list to a user from an ID list.

# <CORE_HOST>: FlowerDocs Core base URL
# <TOKEN>: authentication token
# <IDS>: task identifiers on which to apply the response
# <USERNAME>: assigned user identifier
curl -X PUT "<CORE_HOST>/rest/tasks/<IDS>/assignee/<USERNAME>" \
-H "token: <TOKEN>"