Resources
Users
GET /users/{user_id}
(Authenticated) Return user with corresponding id
- Path Parameters
user_id
UUID format
- Response
application/json
- 200 OK
- User
GET /users?username=
(Authenticated) Return list of condensed user information given search term
- Query Parameters
username
username of the user to search for
- Response
application/json
- 200 OK
- List[UserInfo]
POST /users
(Authenticated) Create a new user in the system using the information provided. Note: The user must have been previously registered in Cognito
- Body Parameters
CreateUserRequest
CreateUserRequest
- Response
application/json
- 201 CREATED
- User
Exercises
GET /exercise/{exercise_id}
Return exercise with corresponding id
- Path Parameters
exercise_id
UUID format
- Response
application/json
- 200 OK
- Exercise
GET /exercise?name=
Return list of exercises given search term
- Query Parameters
name
name of the exercise to search for
- Response
application/json
- 200 OK
- List[Exercise]
Workout-Templates
POST /users/{user_id}/workout-templates
(Protected) Creates a new workout-template for an existing user
- Path Parameters
user_id
UUID format
- Body Parameters
CreateWkTemplateRequest
CreateWkTemplateRequest
- Response
application/json
- 201 CREATED
- WorkoutTemplate
DELETE /users/{user_id}/workout-templates/{workout_template_id}
(Protected) Delete a user’s workout template with corresponding user id and template id
- Path Parameters
workout_template_id
UUID formatuser_id
UUID format
- Response
- 204 NO CONTENT
GET /users/{user_id}/workout-templates
(Authenticated) Return a summary of all templates for a given user
- Path Parameters
user_id
UUID format
- Response
application/json
- 200 OK
- GetAllTemplatesResponse
GET /users/{user_id}/workout-templates/{workout_template_id}
(Authenticated) Return a detailed description of a given template for a given user
- Path Parameters
workout_template_id
UUID formatuser_id
UUID formt
- Response
application/json
- 200 OK
- GetTemplateResponse
Definitions
User
{
"id": "string (UUID format)",
"username": "string",
"display_name": "string",
"date_joined": "string (YYYY-MM-DD format)",
"date_of_birth": "string (YYYY-MM-DD format) or null",
"height": "integer or null",
"weight": "number (float) or null",
"gender": "integer or null",
"fitness_goal": "integer or null",
"fitness_level": "integer or null"
}
UserInfo
{
"id": "string (UUID format)",
"username": "string",
"display_name": "string",
}
CreateUserRequest
{
"uuid": "string (UUID format)",
"username": "string",
"date_joined": "string (YYYY-MM-DD format)"
}
Exercise
{
"id": "string (UUID format)",
"name": "string",
"main_muscle_group": "integer or null",
"secondary_muscle_group": "integer or null",
"necessary_equipment": "integer or null",
"exercise_type": "integer or null"
}
WorkoutTemplate
{
"id": "string (UUID format)",
"user_id": "string (UUID format)",
"name": "string",
"description": "string or null",
"date_created": "string (YYYY-MM-DD format)"
}
CreateWkTemplateRequest
The elements
array must follow specific rules for the structure to be valid. The position of the exercises should range from 0 to n, without any missing spots or repetitions. Superset values should range from 0 to m, with at least two exercises sharing the same superset value. Additionally, for a given superset value, all exercises must have sequential position values.
{
"name": "string",
"description": "string or null",
"date_created": "string (YYYY-MM-DD format)",
"elements": [
{
"exercise_id": "string (UUID format)",
"position": "integer",
"reps": "integer",
"sets": "integer",
"weight": "integer",
"rest": "integer",
"super_set": "integer or null"
}
]
}
GetAllTemplatesResponse
{
"count": "integer",
"templates": [
{
"id": "string (UUID format)",
"user_id": "string (UUID format)",
"name": "string",
"description": "string or null",
"date_created": "string (YYYY-MM-DD format)"
}
]
}
GetTemplateResponse
{
"id": "string (UUID format)",
"user_id": "string (UUID format)",
"name": "string",
"description": "string or null",
"date_created": "string (YYYY-MM-DD format)",
"elements": [
{
"id": "string (UUID format)",
"workout_template_id": "string (UUID format)",
"exercise_id": "string (UUID format)",
"exercise_name": "string",
"position": "integer",
"reps": "integer",
"sets": "integer",
"weight": "integer",
"rest": "integer",
"super_set": "integer or null"
}
]
}