GET /plans
Request URL
UAT environment:
https://us-central1-gofa-sdk.cloudfunctions.net/expressApp/plans
PRD environment:
https://us-central1-gofa-sdk-prd.cloudfunctions.net/expressApp/plans
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/lessons?clientId=abc&clientSecret=abcSecretKey123
Headers:
Authorization: Bearer <ID Token>
Response
Sample Response (200 OK):
[
{
"clonedFrom": "ctUVkdoGDmM66bhZUseN",
"clientId": "bupa",
"planName": "Mindful Movement Journey",
"description": {
"zh_Hans": "本计划旨在提供一个为期 7 天的旅程,专注于平衡、恢复及正念。",
"en": "This plan is designed to provide a 7-day journey targeting balance, recovery, and mindfulness.",
"zh_Hant": "此計劃旨在提供一個為期 7 天的旅程,專注於平衡、恢復及正念。"
},
"planDescription": "A 7-day plan targeting balance, recovery, and mindfulness",
"planImage": "https://storage.googleapis.com/gofa-sdk.appspot.com/lesson-plans%2Fmindful-movement-journey.jpeg",
"title": {
"zh_Hans": "正念运动之旅",
"en": "Mindful Movement Journey",
"zh_Hant": "正念運動之旅"
},
"targetAreas": [
"Full Body",
"Upper Body"
],
"tags": [
"Mirroring"
],
"lessons": [
"FVlyamsYSedDNFxGHvpp",
"zCJVEtxqRed76eKyGsXb",
"SwkNN6kKfxrOYq7oZnLp",
"QW9EnYLdFwcNFHoZmKds",
"gMHnU6IROvZgm59JZ0KF",
"vS7i6NlHalGviykw88Ha",
"bfbE9xqyqdS19GCxJrTW"
],
"id": "A1uuEJu5XzWQhGKpzhwJ"
},
{
"clonedFrom": "GfxepuZC5WRvObPZAvjN",
"clientId": "bupa",
"planName": "Gentle Recovery",
"description": {
"zh_Hans": "本计划专注于温和伸展以恢复及放松。",
"en": "This plan focuses on gentle stretches for recovery and relaxation.",
"zh_Hant": "此計劃專注於溫和伸展以恢復及放鬆。"
},
"planDescription": "Gentle stretches for recovery and relaxation",
"planImage": "https://storage.googleapis.com/gofa-sdk.appspot.com/lesson-plans%2Fgentle-recovery.jpeg",
"title": {
"zh_Hans": "温和恢复",
"en": "Gentle Recovery",
"zh_Hant": "溫和恢復"
},
"targetAreas": [
"Full Body"
],
"tags": [
"Mirroring"
],
"lessons": [
"FVlyamsYSedDNFxGHvpp",
"zCJVEtxqRed76eKyGsXb",
"OqJ2HIPunqmQc8DyeyCp"
],
"id": "C86zuV1wnNd7EFrx0FbP"
},
...
]
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):
Plans 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.