Challenges API
GET /api/challenges
List all challenges for the authenticated client.
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.
Query Parameters
clientId: string (required) — The client identifier. If not found, a 500 error is returned.
Headers:
Authorization: Bearer <JWT>
Response
200 OK:{ data: Array<Challenge> }500 Internal Server Error:{ error: 'Client ID not found' | string }
Each Challenge object includes:
{
"id": "challenge123",
"title": {
"en": "Pushup Challenge",
"zh-Hant": "伏地挺身挑戰",
"zh-Hans": "俯卧撑挑战"
},
"description": {
"en": "Do as many pushups as you can!",
"zh-Hant": "盡量多做伏地挺身!",
"zh-Hans": "尽量多做俯卧撑!"
},
"videoUrl": "https://example.com/challenge.mp4",
"thumbnailUrl": "https://example.com/challenge.png",
"repCounterConfig": {
/* ... */
},
"algo": "pose-checkpoints",
"type": "timeAttack",
"repForMaxScore60Seconds": 50,
"durationForMaxScore30Reps": 60,
"caloriesBurnedPerRep": 0.5,
"order": 1,
"status": "active",
"createdAt": "2024-05-01T10:00:00.000Z",
"updatedAt": "2024-05-10T10:00:00.000Z"
}
Requires a valid JWT for the client.
Returns all challenge objects for the client.
The actual schema may include additional fields. For the most up-to-date schema, refer to the challenge model/interface in your codebase.
All fields may not be present on every challenge. Optional and nullable fields are indicated above.
title and description are multilingual objects supporting en, zh-Hant, and zh-Hans keys.