API – Course Report
- To get the course report you need to send GET request to the following URI https://your-domain.davintoo.com/api/v2/courses/report/{courseId}?page=1&count=10&filter[courseId]={courseId}&sorting[task_finish_date]=desc
- The request 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/courses/report/1309?page=1&count=10&filter[courseId]=1309&sorting[task_finish_date]=desc' -H 'Authorization: Bearer xxxxxx' -H 'Content-Type: application/json;charset=UTF-8'
Instead of 1309, specify the course id.
The request supports filtering by the following fields:
- taskId - Task ID
- user_full_name - User fullname
- city - City
- department - Department
- task_finish_date - period by date of completion
An example of a query with a filter by date of course completion:
curl 'https://your-domain.davintoo.com/api/v2/courses/report/1309?page=1&count=10&filter[courseId]=1309&filter[task_finish_date]=2021-11-19&filter[task_finish_date]=2021-12-21&sorting[task_finish_date]=desc' -H 'Authorization: Bearer xxxxxx' -H 'Content-Type: application/json;charset=UTF-8'
Answer
- In case of successful request (HTTP response code - 200).
The following result will be returned:
- results arraydata
- pagination object (information about the number of pages, the current page, the number of results)pager
- detailed information about course settingscourse
- information about resources in the course plan (id and title)plan
- In case of error (HTTP response code - 400) it returns JSON object with error information