API – Checklist report
To receive a report from the checklist on all tasks you need to:
- send GET request to URI https://your-domain.davintoo.com/api/v2/check-list/report/{id}
- the request must contain headings Content-Type: application/json;charset=UTF-8 and Authorization: Bearer xxxxxx.
Request exapmle:
curl 'https://your-domain.davintoo.com/api/v2/check-list/report/233'
-H 'Authorization: Bearer xxxxxx'
-H 'Content-Type: application/json;charset=UTF-8'
The request supports filtration by the following fields:
- Positionposition
- Citycity
- Departmentdepartment
- Tagtags
- Date of filling in the questionnaire in the checklistresult_updated_at
- Current status of the questionnaire in the checklistresult_status
If you created several tasks for the checklist, you can add a filter with the task id and display the results of a particular task, so you don't have to print all the tasks in the message.
Request example:
curl 'https://your-domain.davintoo.com/api/v2/check-list/report/233?filter[taskId]=36413'
-H 'Authorization: Bearer xxxxxx'
-H 'Content-Type: application/json;charset=UTF-8'
Answer
-
In case of successful request (HTTP response code - 200), the result will be returned in the form of:
- result arraydata
- the object of pagination (information about the number of pages, the current page, and the results)pager
-
In case of a mistake (HTTP response code - 400) returns JSON object with information about the error:
{"title":{"required":"Field cannot be empty"}}
Detailed report on checklists
To export a detailed report on the questionnaire in the checklist, where the name of the criterion and the reverse score on the scale will be indicated, you need to:
- send GET request to URI https://your-domain.davintoo.com/api/rest.php/check-lists-result/?action=get-sub-task-details&sub_task_id={id}
- the request must contain headings Content-Type: application/json;charset=UTF-8 and Authorization: Bearer xxxxxx.
Request exapmle:
curl 'https://your-domain.davintoo.com/api/rest.php/check-lists-result/?action=get-sub-task-details&sub_task_id=36419'
-H 'Authorization: Bearer xxxxxx'
-H 'Content-Type: application/json;charset=UTF-8'
Answer
-
In case of successful request (HTTP response code - 200), the result will be returned in the form of:
- criterion groups and criteria;subTask.element.criteriaGroup
- variants of the scale in the checklist;subTask.element.scale.answers
-result array.answers
-
In case of a mistake (HTTP response code - 400) returns JSON object with information about the error