API – Assigning a task to a user
Use the API token for authorization. Read more in the article API token
- To assign a task to a user you need to send POST request to the following URI https://your-domain.davintoo.com/api/v2/tasks/{taskId}/assign-user-multi
- The query string must contain {taskId} Id of the task.
- The body of the query must contain a JSON object with the fields:
- Id of the userusers:[{"id":}]
- assigntype
- The query must contain the headings Content-Type: application/json;charset=UTF-8 and Authorization: Bearer xxxxxx.
Request example:
curl 'https://your-domain.davintoo.com/api/v2/tasks/36404/assign-user-multi' -H 'Authorization: Bearer xxxxxx' -H 'Content-Type: application/json;charset=UTF-8' --data-raw '{"users":[{"id":5694}, {"id":5430}],"type":"assign"}'
Instead of a local address https://your-domain.davintoo.com you need to use the address of your instance.
Answer
-
In case of successful request (HTTP response code - 200), the result will be returned like this:
- empty arraydata
- total number of users assigned to the taskusers_of_task
-
In case of error (HTTP response code - 400) it returns JSON object with error information