Get Course Lesson Comments
This endpoint retrieves paginated lesson comments for a specific lesson with id {lesson_id}
for the course identified
by {course_id}
and under the section identified by {section_id}
.
If the parent
id is passed then it returns all comments that have the given id as their parent (comments that are
children of the parent
).
If the parent
id is not passed then it returns all first level comments of the lesson (comments with null parent
id).
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.
If comments_enabled
is false then it will return:
{
"count": 0,
"next": null,
"previous": null,
"results": []
}
HTTP Request
GET /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 comments |
section_id | path | string | true | A unique integer value identifying the section of the comments |
lesson_id | path | string | true | A unique integer value identifying the lesson of the comments |
limit | query | integer | false | Number of results to return per page |
offset | query | integer | false | The initial index from which to return the results |
parent | query | string | false | Id of the parent Course Comment; used for retrieve nested comments |
ordering | query | string | false | The ordering of the comments; use - for order desc.Default to created_at |
Enumerated Values
Parameter | Value | Description |
---|---|---|
» ordering | created_at | Order by comment creation datetime |
Example Request
- JavaScript
- Bash
const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/comment/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/comment/ \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | list(Course Comment) |