GET /lesson
Request URL
UAT environment:
https://us-central1-gofa-sdk.cloudfunctions.net/expressApp/lesson/{lessonId}
PRD environment:
https://us-central1-gofa-sdk-prd.cloudfunctions.net/expressApp/lesson/{lessonId}
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lessonId | String | Yes | The identifier for the Lesson data |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
clientId | String | Yes | The identifier for the GOFA client. |
clientSecret | String | Yes | The secret key for authenticating the GOFA client's identity. |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | String | Yes | Bearer token retrieved from Firebase Auth. Example: Bearer <ID Token> |
Authentication
GOFA clients must use a Bearer token for authorization. The ID Token can be retrieved by signing in through Firebase Auth, either via the Web SDK or the Firebase Auth REST API.
Sample Request
GET https://us-central1-gofa-sdk.cloudfunctions.net/expressApp/lesson/oCcBJHjwsoSpDFjtmVkV?clientId=abc&clientSecret=abcSecretKey123
Headers:
Authorization: Bearer <ID Token>
Response
Sample Response (200 OK):
{
"groupByTypes": [
"STRENGTH"
],
"modifyDatetime": {
"_nanoseconds": 175000000,
"_seconds": 1719556448
},
"description": {
"en": "Tone your arms and back with this supercharged Arms and Back Builder. All you need to get going is about 12 minutes and your trusty dumbbells.",
"zh": "使用這款增壓的 Arms and Back Builder 調整您的手臂和背部。您只需要大約 12 分鐘和值得信賴的啞鈴即可開始鍛煉。"
},
"videoId": "4df4c7c9a97ea27ef734d9aa9666f29a",
"isIndividual": true,
"videoURLs": [
"https://videodelivery.net/4df4c7c9a97ea27ef734d9aa9666f29a/manifest/video.m3u8"
],
"title": {
"en": "Arms And Back Builder",
"zh": "手臂和背部鍛鍊"
},
"groupByGoals": [
"WEIGHT_LOSS",
"GET_LEAN_AND_TONED",
"BUILD_STRENGTH"
],
"duration": 12,
"groupByEquipments": [
"DUMBELLS"
],
"groupByIntensity": "BREAK_A_SWEAT",
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/goalfit-cloud-staging.appspot.com/o/workouts%2FJUA6ntXhHViwlm4R8mUu%2Fimage?alt=media&token=4aa22aaf-5e55-4f02-ab77-1889ac5185d4",
"modifiedBy": "SYSTEM",
"id": "vnuMdpBfCXt3PedDASP0",
"uniqueID": "abc-Strength #13",
"algorithm": "VIDEO_COUNT",
"clonedFrom": "Strength #13",
"sessions": [
{
"aiScripts": [],
"rule": null,
"index": 0,
"videoURLs": [],
"audioURLs": [],
"timeout": 3.8666666666666667
},
{
"aiScripts": [],
"index": 1,
"rule": {
"poseName": "BENT_OVER_ROW",
"count": {
"display": true,
"value": 15,
"required": true
},
"selectOption": "time",
"time": {
"display": true,
"value": 0.7333333333333333,
"required": true
},
"poseId": "BENT_OVER_ROW",
"title": {
"zh_Hans": "俯身划船",
"en": "Bent-Over Row",
"zh_Hant": "俯身划船"
}
},
"control": null,
"videoURLs": [],
"audioURLs": [],
"timeout": 1.6666666666666667
},
{
"aiScripts": [],
"index": 2,
"rule": null,
"videoURLs": [],
"audioURLs": [],
"timeout": 0.6666666666666666
},
{
"aiScripts": [],
"index": 3,
"rule": {
"poseName": "PUSH_UP",
"selectOption": "time",
"count": {
"display": true,
"value": 15,
"required": true
},
"time": {
"display": true,
"value": 0.6833333333333333,
"required": true
},
"poseId": "PUSH_UP",
"title": {
"zh_Hans": "伏地挺身",
"en": "Push-up",
"zh_Hant": "伏地挺身"
}
},
"control": null,
"videoURLs": [],
"audioURLs": [],
"timeout": 1.6666666666666667
},
...
{
"aiScripts": [],
"index": 10,
"rule": null,
"videoURLs": [],
"audioURLs": [],
"timeout": 2.1666666666666665
}
],
"groupByStyles": [
"TONE",
"LEAN"
],
"clientId": "abc",
"batch": 1,
"sync": true,
"thumbImageUrl": "https://firebasestorage.googleapis.com/v0/b/gofa-f0630.appspot.com/o/workouts%2FJUA6ntXhHViwlm4R8mUu%2Fthumb_image?alt=media&token=ea9a5fff-d4b3-499a-92ff-b1f6e5832554",
"intensity": "5",
"createDatetime": {
"_nanoseconds": 175000000,
"_seconds": 1719556448
},
"groupByMuscles": [
"ARMS",
"UPPER_BODY"
],
"createdBy": "SYSTEM",
"groupByTrainers": [
"BREANN"
],
"MET": 0,
"subtitleUrl": {
"en": "https://storage.googleapis.com/gofa-sdk.appspot.com/lessons%2Fsubtitles%2Fen%2FStrength%20%2313.vtt",
"zh": "https://storage.googleapis.com/gofa-sdk.appspot.com/lessons%2Fsubtitles%2Fzh%2FStrength%20%2313.vtt"
},
"status": "active"
}
Error Responses
| Status Code | Error Message | Description |
|---|---|---|
403 | Forbidden | Provided credentials are incorrect or cannot be found. |
404 | Not Found | The data cannot be found. |
Sample Error Response (403 Forbidden):
Unauthorized
Sample Error Response (404 Not Found):
User not found
Rate Limiting
Rate limiting is essential to ensure fair usage and protect the system from abuse. The proposed rate limiting policy is as follows:
- 60 requests per minute per client: Standard rate limit for most clients.
- Burst limit: Up to 100 requests within a short burst to accommodate occasional high demand.
- Exceeding Limits: Clients exceeding rate limits will receive a
429 Too Many Requestsstatus code.
Notes
- Ensure the Bearer token provided in the request header is valid.
- Make sure to keep your
clientSecretsecure and do not expose it in client-side code. - This endpoint returns timestamps in Unix epoch format with seconds and nanoseconds for precision.