Skip to content

Returns a single lesson by course and lesson slug, with its access decision resolved and its body parsed only when the caller may read it.

Access folds together enrolment, the section unlock date for structured and scheduled courses, sequential lesson ordering, and the public-lesson-view setting that lets public self-paced courses be read without enrolling. When access is denied the lesson still comes back, but locked, carrying a lock_type and where relevant an unlock_date. Draft lessons are visible only to course admins.

Endpoint

  • Method: GET

  • Path: /courses/{course_slug}/lessons/{lesson_slug}/by-slug

  • Edition: Core

  • Controller: CourseController@getLessonBySlug

  • Route source: fluent-community/Modules/Course/Http/course_api.php:13

  • Controller source: fluent-community/Modules/Course/Http/Controllers/CourseController.php

  • Secret courses return an error unless the caller is enrolled or is a course admin.

  • The fluent_community/course/can_view_lesson filter can override the decision, so integrations may widen or narrow access.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

GET Get Lesson By Slug

GET
/courses/{course_slug}/lessons/{lesson_slug}/by-slug

Returns a single lesson by course and lesson slug, with its access decision resolved and its body parsed only when the caller may read it.

Controller: CourseController@getLessonBySlug
Route source: fluent-community/Modules/Course/Http/course_api.php:13

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Path Parameters

course_slug*

Course Slug extracted from the URL path.

Type
string
Required
lesson_slug*

Lesson Slug extracted from the URL path.

Type
string
Required

Responses

Successful response

application/json
JSON
{
  
"lesson": {
  
  
"can_view": true,
  
  
"comments_count": 0,
  
  
"content": "string",
  
  
"content_type": "string",
  
  
"course_id": "string",
  
  
"created_at": "string",
  
  
"featured_image": "string",
  
  
"id": 0,
  
  
"inline_css": "string",
  
  
"is_locked": true,
  
  
"lock_type": "string",
  
  
"meta": {
  
  
  
"auto_complete_on_video_end": "string",
  
  
  
"document_ids": [
  
  
  
  
{
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"document_lists": [
  
  
  
  
{
  
  
  
  
  
"additionalProperties": "string"
  
  
  
  
}
  
  
  
],
  
  
  
"enable_comments": "string",
  
  
  
"enable_media": "string",
  
  
  
"enable_passing_score": "string",
  
  
  
"enforce_passing_score": "string",
  
  
  
"free_preview_lesson": "string",
  
  
  
"hide_result": "string",
  
  
  
"is_video_gated": true,
  
  
  
"media": {
  
  
  
  
"provider": "string"
  
  
  
},
  
  
  
"passing_score": 0,
  
  
  
"require_video_completion": "string",
  
  
  
"video_auto_complete": true,
  
  
  
"video_completion_threshold": 0,
  
  
  
"video_length": 0,
  
  
  
"video_watched": true
  
  
},
  
  
"section_id": "string",
  
  
"slug": "string",
  
  
"title": "string",
  
  
"unlock_date": "string"
  
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation