Skip to main content

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

NameTypeRequiredDescription
playIdStringYesThe identifier for the Lesson Play data

Query Parameters

NameTypeRequiredDescription
clientIdStringYesThe identifier for the GOFA client.
clientSecretStringYesThe secret key for authenticating the GOFA client's identity.
clientUserIdStringYesThe unique identifier of the client's end user engaging with GOFA.

Headers

NameTypeRequiredDescription
AuthorizationStringYesBearer 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 CodeError MessageDescription
403ForbiddenProvided credentials are incorrect or cannot be found.
404Not FoundThe 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 Requests status code.

Notes

  • Ensure the Bearer token provided in the request header is valid.
  • Make sure to keep your clientSecret secure and do not expose it in client-side code.
  • This endpoint returns timestamps in Unix epoch format with seconds and nanoseconds for precision.