GET /scorm/packages/usage
GET /scorm/packages/usage
GET /api/scorm/packages/usage - Get SCORM packages with usage information Verify authentication with Clerk Get user profile for permission checking Check if user is admin (only admins can view usage information) Fetch all SCORM packages for this tenant from SCORM API localhost:3001'; If SCORM API is unavailable, try querying scorm_packages table directly as fallback Fallback: try querying scorm_packages table directly For each package, find activities that use it Find activities that reference this package Get all SCORM activities and filter in code (JSONB queries can be tricky) Filter activities that use this package Extract unique courses from activities Calculate totals
Endpoint
GET /scorm/packages/usage
Authentication
This endpoint requires authentication. Include your authentication token in the request headers.
Error Responses
| Status Code | Error Code | Description |
|---|---|---|
| 401 | HTTP_401 | Unauthorized |
| 404 | HTTP_404 | Not Found |
| 403 | HTTP_403 | Forbidden |
| 500 | HTTP_500 | Internal Server Error |
Example Request
curl -X GET "https://api.allurelms.com/scorm/packages/usage" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"