Get User Sessions
This endpoint retrieves the workout sessions associated with a given user.
Endpoint
GET /v1/{clientName}/users/{userId}/sessions
Path Parameters
clientName
: The name of the client (given during onboarding).userId
: Unique identifier of the user.
Response
user_id
: The unique identifier of the user.tot_nr_of_workouts
: Total number of workouts completed by the user.workouts
: A list containing the details of each workout session.session_id
: Unique identifier for the workout session.workout_id
: Identifier associated with the workout.meta
: Metadata associated with the workout session.session_length
: An array that contains the length (in seconds) of each active session under the samesession_id
.total_reps
: Total number of repetitions completed in the session.total_score
: Overall score achieved in the session.session_start_times
: An array of timestamps indicating when each active session under the samesession_id
started.exercise_stats
: A list of statistics for each exercise in the workout.rep_count
: Number of repetitions for the exercise.score
: Score achieved for the exercise.exercise_name
: Name of the exercise.exercise_idx
: Index of the exercise in the workout.
total_kcal
: Total calories burned in the session.
timestamp
: Time at which the session was completed (or last updated).
Example Response
If successful, the endpoint will return a JSON object containing the user’s ID, the total number of workouts they’ve completed, and a list of their workout sessions.
{
"user_id": "123123",
"tot_nr_of_workouts": 2,
"workouts": [
{
"session_id": "496c0ec0-d918-48e3-88c2-02964ad3afe3",
"workout_id": "lMyqJKrmclQUDXB5XZ4L",
"meta": {
"total_reps": 0,
"total_score": 0,
"exercise_stats": [],
"total_kcal": 0
},
"timestamp": "1694108063999"
},
{
"session_id": "e82396f8-9f08-4204-85b1-12acdbd3ecdb",
"workout_id": "lMyqJKrmclQUDXB5XZ4L",
"meta": {
"session_length": [
63
],
"total_reps": 120,
"total_score": 1000,
"session_start_times": [
1694185002660
],
"exercise_stats": [
{
"rep_count": 15,
"score": 66,
"exercise_name": "jumping_jack",
"exercise_idx": 1
}
],
"total_kcal": 10
},
"timestamp": "1694185074996"
}
]
}