GET /play
Request URL
UAT environment:
https://us-central1-gofa-sdk.cloudfunctions.net/expressApp/play/{playId}
PRD environment:
https://us-central1-gofa-sdk-prd.cloudfunctions.net/expressApp/play/{playId}
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playId | String | Yes | The identifier for the Lesson Play 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. |
clientUserId | String | Yes | The unique identifier of the client's end user engaging with GOFA. |
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/play/VxEe2ZmI6U9EJ2oYkRgO?clientId=abc&clientSecret=abcSecretKey123&clientUserId=isaacchan
Headers:
Authorization: Bearer <ID Token>
Response
Sample Response (200 OK):
{
"playId": "VxEe2ZmI6U9EJ2oYkRgO",
"createdAt": {
"_seconds": 1699949568,
"_nanoseconds": 186000000
},
"totalRepCount": null,
"averageEngagementLevel": null,
"planId": null,
"planPlayId": null,
"lessonUniqueId": "Cardio-HIIT #14",
"totalSecondsSpent": 3,
"status": "cancelled",
"lessonId": "9L7EroR6FZ0xO8tX8fg9"
}
```
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.