Create a Course Comment
This endpoint creates a comment for a specific lesson with id {lesson_id}
for the course identified by {course_id}
and under the section identified by {section_id}
.
If in_reply_to
is passed then also parent
is mandatory and it must be the same parent
as the parent
present in
the comment identified by in_reply_to
.
info
This operation requires the user joins the course and that the lesson has comments_enabled
(also managers).
Users with role manager can always get a lesson while the other users should follow the rules setup by the
managers.
Rules:
- lesson should be
published
; - if the course
type
isscheduled
the current datetime should be greater than or equal todripped_at
; - if the course
type
isstructured
the current datetime should be greater than or equal to thejoined_at
datetime plusdrip_delay
days; - if the course has
enforce_lessons_order
set to true then all the published lessons before the current one should be completed.
HTTP Request
POST /api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/comment/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
course_id | path | string | true | A unique integer value identifying the course of the comment |
section_id | path | string | true | A unique integer value identifying the section of the comment |
lesson_id | path | string | true | A unique integer value identifying the lesson of the comment |
body | body | Course Comment | true | The request body (course comment params) |
Example Body Parameters
- JSON
{
"parent": "integer",
"text": "string",
"medias": []
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"parent": "integer",
"text": "string",
"medias": []
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/comment/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/comment/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
--DATA '{body}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Course Comment |