GET /api/v1/lessons/{lessonId}/discussion
Tells the key's holder where the discussion of a lesson stands. The comments
under a lesson live in one thread of the program's community space, opened
by the first comment. Until then, threadId is null. Read the comments
themselves with Read a thread.
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed — as when previewing the program |
ADMIN | Allowed — as when previewing the program |
MEMBER | Conditional — on a lesson its own enrollment lets it read |
| Requirement | Rule for this endpoint |
|---|---|
| Business role | None |
| Resource scope | The lesson belongs to the key's organization |
| Participation | For a MEMBER: an enrollment that can read the lesson, which is not locked by the learning path |
| Resource state | Published lesson, in an active course, of a program that is not archived |
| Parameter | Type | Required | Description |
|---|---|---|---|
lessonId | UUID | yes | Lesson of the key's organization |
curl "$COHORTE_API_BASE_URL/api/v1/lessons/$LESSON_ID/discussion" \
-H "x-api-key: $COHORTE_API_KEY"200 OK — the state of the discussion.400 Bad Request — lessonId is not a UUID.401 Unauthorized — missing, unknown or expired key.404 Not Found — the lesson is unknown, belongs to another school, or the key's holder cannot read it.| Field | Type | Nullable | Description |
|---|---|---|---|
success | boolean | no | true |
data.state | string | no | open, no_space (the program has no community space), reserved (the holder cannot read that space) or unavailable (the thread was deleted or the lesson unpublished) |
data.spaceId | UUID | yes | The community space; null unless open |
data.spaceName | string | yes | Its name; null unless open |
data.threadId | UUID | yes | The lesson's thread; null until the first comment |
data.readOnly | boolean | no | true when the holder cannot comment (archived space, no right to post, or any state other than open) |
{
"success": true,
"data": {
"state": "open",
"spaceId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
"spaceName": "Entraide",
"threadId": null,
"readOnly": false
},
"correlationId": "c0ffee00-1111-4222-8333-444455556666"
}