LMS Collaborator knowledge base

Home/Technical requirements/API/API - Create a checklist task

API – Create a checklist task

  • To create a task for the checklist, send PUT request to URI
    https://localhost:8080/api/rest.php/tasks
  • The body of the request must contain a JSON object with the parameters of the task.
  • The request must contain the following headings Content-Type: application/json;charset=UTF-8 и Authorization: Bearer xxxxxx.

Request example:
curl -X POST 'https://localhost:8080/api/rest.php/tasks' --data-raw '{"type":"check-list","element_id":197,"title":"Mentor's evaluation of the newcomer","description":"","tags":["стажування"],"threshold":85,"has_exact_time":"true","time_start":"","time_finish":"","date_range":["2022-05-13", "2022-05-20"],"date_start":"2022-05-13","date_finish":"2022-05-20","not_block_after_expiration":true,"allow_comments":true,"reminder_enabled":true,"evaluate_type":"evaluates-tutor"}'
-H 'Authorization: Bearer xxxxxx'
-H 'Content-Type: application/json;charset=UTF-8'

Field Parameter description
type Task type
element_id checklist id
title Task title
description Task description
tags Tags
threshold Completion threshold, in %
date_start Task start date
date_finish Task completion date
not_block_after_expiration Do not close access after the deadline
allow_comments Allow commenting
reminder_enabled Enable reminders
evaluate_type Evaluation mode (evaluates-tutor - tutor evaluation, self_esteem - self-esteem)

Request example:
curl -X POST 'https://localhost:8080/api/rest.php/task-check-list-settings/34423' --data-raw '{"show_result_to_user":true}'
-H 'Authorization: Bearer xxxxxx'
-H 'Content-Type: application/json;charset=UTF-8'


Answer

In case of successful request (HTTP response code - 200), there will be reply in JSON format with information about created task.


In case of error (HTTP response code - 400) it returns JSON object with error information:
{"title":{"required":"Field cannot be empty"}}

Still have questions?
Our technical support team is always happy to help!
Write to us at technical support [email protected]. If you are registered on our Helpdesk - send request button below.
Send request