Skip to main content

Lesson Plans API

GET /api/lesson-plans

List all lesson plans for the authenticated client.

Query Parameters

  • clientId: string (required) — The client identifier. Requests without this parameter will return a 400 error.
  • tags: string (optional, comma-separated) — Filter lesson plans by tags.
note

Authenticated B2B API requests to this endpoint are usage-metered at the platform level. Commercial plans may apply request tracking, quota checks, or billing rules to this API family as GOFA's public API platform expands. This note does not change the current request or response contract for existing integrations.

Headers:

  • Authorization: Bearer <JWT>

Response

  • 200 OK: { data: Array<LessonPlan> }
  • 400 Bad Request: { error: 'clientId is required.' }
  • 401 Unauthorized: { error: string }
  • 500 Internal Server Error: { error: string }

Each LessonPlan object includes:

Sample LessonPlan Object
{
"id": "plan123",
"clientId": "gofa",
"planName": "Obsolete Name",
"title": {
"en": "Strength Plan",
"zh-Hant": "力量計劃",
"zh-Hans": "力量计划"
},
"planDescription": "Obsolete Description",
"description": {
"en": "A plan for building strength.",
"zh-Hant": "增強力量的計劃。",
"zh-Hans": "增强力量的计划。"
},
"planImage": "https://example.com/image.png",
"lessons": ["lesson1", "lesson2"],
"lessonsData": [
{
"id": "lesson1",
"title": { "en": "Lesson 1" },
"duration": 30,
"sessions": []
},
{
"id": "lesson2",
"title": { "en": "Lesson 2" },
"duration": 25,
"sessions": []
}
],
"tags": ["strength", "beginner"],
"targetAreas": ["arms", "legs"],
"totalViews": 100,
"totalPlays": 50,
"totalCompletions": 20,
"lastViewed": "2024-05-24T10:00:00.000Z",
"lastPlayed": "2024-05-24T10:00:00.000Z",
"lastCompleted": "2024-05-24T10:00:00.000Z",
"currentPlanPlayId": "play789",
"completedLessons": ["lesson1"],
"modifyDatetime": { "_seconds": 1716544800, "_nanoseconds": 0 },
"createDatetime": { "_seconds": 1716541200, "_nanoseconds": 0 },
"duration": 14,
"expiryReminder": 2
}

Localizable Example

{
"en": "Strength Plan",
"zh-Hant": "力量計劃",
"zh-Hans": "力量计划"
}

GET /api/lesson-plans/[id]

Fetch a lesson plan by its ID.

Headers:

  • Authorization: Bearer <JWT>

Path Parameters:

  • id: string (required) — The lesson plan's unique identifier

Response:

  • 200 OK: { lessonPlan: LessonPlan }
  • 404 Not Found: { error: string }
  • 401 Unauthorized: { error: string }
  • 500 Internal Server Error: { error: string }

note

The actual schema may include additional fields. For the most up-to-date schema, refer to the lesson plan and lesson config interfaces in your codebase.
All fields may not be present on every lesson plan. Optional and nullable fields are indicated above.
lessonsData contains lesson config objects; see the LessonConfig schema for details.
Localizable fields support English (en), Traditional Chinese (zh-Hant), and Simplified Chinese (zh-Hans).