sessions

Retrieving Sessions within your Organization

Retrieve recorded movement session(s).

GET https://487q8d7goe.execute-api.us-east-1.amazonaws.com/production/sessions

Obtains all of the recorded movement sessions (excluding free sessions) or specific sessions within your Valor account based on query parameters.

Query Parameters

Name
Type
Description

athleteID

String

Valor ID of a specific athlete to retrieve subset of sessions (can be extracted from athletes call)

limit

String

Limited number of total sessions to return (used for pagination)

Headers

Name
Type
Description

Authorization*

String

JWT Bearer Token for authentication: Bearer <JWT token>

X-Continuation-Token*

String

Continuation token required for paginating requests. Can be found within the response. Default value should be an empty string encoded as a JSON

{
    "statusCode": 200, 
    "X-Continuation-Token": "{Continuation Token}", //null when all sessions retrieved
    "body": [] //Array of sessions found
}

Note: When retrieving multiple sessions it is highly recommended to paginate your requests using the limit & X-Continuation-Token parameters. See examples below:

import requests
import json

# Define the API endpoint
api_url = 'your_api_url'

# Initialize an empty list to store all items
all_items = []

# Default continuation token should be an emptry string wrapped in a json
continuation_token = json.dumps("")

# Replace 'your_jwt_token' with your actual JWT token
jwt_token = 'your_jwt_token'

while True:
    # Create headers with the X-Continuation-Token and JWT token
    headers = {
        'X-Continuation-Token': continuation_token,  # Include the continuation token
        'Authorization': f'Bearer {jwt_token}'
    }

    # Define query parameters
    params = {
        'limit': '', # Replace with the limit you need (Default = '')
        'athleteID': ''  # Replace with the athlete ID you need (Default = '')
    }

    # Make the API request with the headers and query parameters
    response = requests.get(api_url, headers=headers, params=params)

    if response.status_code == 200:
        data = response.json()
        items = json.loads(data.get('body'))

        # Append the items from the current page to the list
        all_items.extend(items)

        # Check if there's a next page
        continuation_token = data.get('X-Continuation-Token')

        if continuation_token != "null":
            continuation_token = json.dumps(continuation_token)

        if continuation_token == "null":
            # No more pages to fetch, exit the loop
            break
    else:
        print(f"Error: {response.status_code}")
        break

Response (Body) Parameters

  1. Session ID: The unique ID of each session

  2. Date: The date the session was recorded (UTC)

  3. s3Key: The s3Key associated with the session. Note: This is critical to use to obtain IK or Valor report data.

  4. Duration: The duration of the session in seconds

  5. Athlete ID: The unique athlete ID of each session

  6. Assessment ID: The unique assessment ID of each session (shared with sessions recorded under the same assessment) or labeled as "singleExercise" if the session was a stand alone recording

  7. Exercise ID: The unique exercise ID of each session

  8. Session Name: The name of the session (usually the name of an exercise)

Last updated