Atlas API v1 Documentation

The official API (version 1) documentation for Atlas Wearables.

Nomenclature


A routine is a group of activities that are planned.

A routine instance is a group of activities that have been completed.

An activity class is a category of a repetitive motion (e.g. sit-up is an activity class).

An activity is a repetitive motion with a specific variation (e.g. sit-up with arms crossed is an activity).

An activity instance is an activity that has been completed.


General Notes


The Atlas API supports HTTP get, post and headers for application and user authentication.

All responses are in JSON format (sorry XML fans) and contain at minimum a status and error array.

All API calls require an application sid and secret. If you need a token just ask Seth and he'll hook you up.

All API calls are rate limited. The base rate limit is 300 requests per minute per user token.

Any API calls that require the end-user to be authenticated take an additional auth_token parameter. The auth_token can be generated by calling the login endpoint.


Example

If you have curl installed you can use the following command to call the "Say Hi" URL. Keep in mind you will need to use your own api_sid and api_secret.


curl --data "api_sid=xUp5HBOp6UabMYc1&api_secret=90vULduF5hyQBx66UzI6LjnyR4ko2rfQ0LP5" https://api.atlaswearables.com/api/v1/hello/noauth/

Returns:

{"status": "ok", "errors": []}

/api/v1/hello/noauth/

This can be used for testing/qc purposes.

Note: Rate limited.

Args

api_sid
api_secret

Returns

status
errors[]

/api/v1/hello/auth/

This can be used for testing/qc purposes.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]

/api/v1/auth/login/

Returns status of "ok" on success and "failed" on error.

Note: Rate limited.

Args

api_sid
api_secret
username
password

Returns

status
token
user_id
errors[]

/api/v1/auth/logout/

Returns status of "ok" on success and "failed" on error.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]

/api/v1/preferences/

Returns preferences for the given user.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
user_id
full_name
first_name
last_name
weight_units ("L" for pounds "K" for kilograms)
friendly_weight_units ("lbs" or "kgs")
weight_in_pounds
weight_in_kilos
wingspan_in_inches
height_feet
height_inches
height_cm
birth_date
gender
synced_program_id
algo_version
profile_picture_url
profile_picture_md5
app_debug
pinned_metric
twentyfour_hour_clock : yes/no
last_synced
last_synced_formatted
max_hr
recovery_threshold
aerobic_threshold
anaerobic_threshold
max_threshold
weight (based on user preferences)
target_cardio_zone_min
target_cardio_zone_max
email_subs = {
    product : boolean,
    beta : boolean,
    news : boolean,
    blog : boolean,
    summary : boolean
}
is_personal_trainer
is_subscribed_to_google
is_subscribed_to_healthkit
freestyle_data_share
user_goals {}

/api/v1/activities/

Returns the canonical list of Atlas exercises with internal IDs.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
activities[{
    id
    name
    class_name
    harvesting_weight (if staff)
}]
classes[{
    id
    name
    harvesting_weight
}]

/api/v1/activities/fast/

Returns the canonical list of Atlas exercises for the current user.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
activity_classes[{
    id
    class_name
}]

/api/v1/activities/done/

Returns the list of all the exercises done by a user with internal and override IDs.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
activity_classes[{
    id
    override_id
    name
}]

/api/v1/activities/[id]/

Returns all exercises that the user has done based on the given exercise id.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
exercises[{
    activity_sequence
    routine_instance_id
    start_time
    end_time
    start_time_raw
    end_time_raw
    exercise{
        id
        name
    }
    set_count
    rep_count
    weight
    weight_units
    hrt_count
    one_rep_max
}]

/api/v1/routines/

Returns a list of routines and a list of exercise names for the given user and program.

Args

api_sid
api_secret
auth_token
program_id [default: fitscore]
include_user_records [default: false]

Returns

status
errors[]
routines[{
    id
    name
    description
    completions
    rep_record
    total_cals
    last_completed_reps
    last_completed_cals
    estimated_duration
    estimated_intensity
    estimated_cals
    program_name
    modified_date
    activities[{
        id
        name
        units [R for reps,S for seconds,L for laps]
        value
        image
        video
        muscle_focus {}
    }]
    raw_user_records []
    raw_user_last []
}]

/api/v1/routine-programs/

Returns a list of routine programs for the given user.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
routine_programs[{
    id
    name
}]

/api/v1/routine/[id]/delete/

Deletes the given routine.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]

/api/v1/routine/add/

Adds a routine to the db and associates it to the user.

Args

api_sid
api_secret
auth_token
routine_name

Returns

status
errors[]
routine_id

/api/v1/routine/[id]/

Returns meta data for the routine and exercise data for the given user/routine_id.

Args

api_sid
api_secret
auth_token
include_user_records [default: false]

Returns

status
errors[]
routine{
    id
    name
    modified_date
    exercises[{
        name
        id
        slot_number
        units
        units_text
        value
        weight
    }]
}

/api/v1/routine/[id]/activity/[slot_number]/

GET: Returns exercise data for the given user/routine_id/slot.
POST: Modifies exercise data for the given slot.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
name
id
slot_number
units
units_text
value
weight

/api/v1/routine/[id]/activities/

GET: Returns exercise data for the given user/routine_id/slots.

Args

api_sid
api_secret
auth_token
slots

Returns

status
errors[]
name
id
slot_number
units
units_text
value
weight

/api/v1/routine/[id]/activity/add/

Adds an activity to a given workout.

Args

api_sid
api_secret
auth_token
routine_instance_id
activity_sequence
start_timestamp (in UNIX epoch GMT)
end_timestamp (in UNIX epoch GMT)
raw_sensor_count
activity_id
activity_class_id
activity_class_override_id
reps
reps_override
weight
weight_override
time
time_override
form_score ('A', 'B' or 'C')
stability
form_score_raw
stability_raw
distance
calories

Returns

status
errors[]
warnings[]

/api/v1/routine/[id]/activity/delete/

Deletes the given exercise from a routine.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]

/api/v1/routineinstances/

Returns all workouts associated to the user's account.

Args

api_sid
api_secret
auth_token
routine_instance_ids [optional]

Returns

status
errors[]
workouts[{
    id
    start_time
    end_time
    start_time_raw
    end_time_raw
    upload_time
    activity_count
    score{
        muscles{
            name{
                score
            }
        }
        groups{
            name{
                score
            }
        }
    }
    routine{
        id
        name
    }
}]

/api/v1/workout/[id]/

Returns all activities associated to a specific workout.

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
workout {
    id
    start_time
    end_time
    start_time_raw
    end_time_raw
    upload_time
    calories
    rest
    percent_rest
    metrics{
        avg_rep_count
        avg_rest_seconds
        avg_velocity
        calories
        form_score
        heartrate{
            avg
            max
            timestamps[]
            values[]
            zone_counts[]
        }
        muscle_group_magnitudes{}
        muscle_magnitudes{}
        rep_count
        rep_index
        rep_index_zone
        rest_index
        rest_index_zone
        rest_seconds
        routine_hash
        velocity
        velocity_index
        velocity_index_zone
        volume
    }
    score{
        muscles{
            name{
                score
            }
        }
        groups{
            name{
                score
            }
        }
    }
    routine{
        id
        name
    }
    activities[{
        activity_sequence
        start_time
        end_time
        start_time_raw
        end_time_raw
        exercise{
            id
            name
        }
        rep_count
        calories
        weight
        weight_units
        hrt_count
        form_score
        metrics{
            active_seconds
            activity_class_id
            calories
            form_score
            heartrate{
                avg
                max
                timestamps[]
                values[]
            }
            muscle_group_magnitudes{}
            muscle_magnitudes{}
            rep_count
            rep_index
            rep_index_zone
            rest_index
            rest_index_zone
            rest_seconds
            velocity
            velocity_index
            velocity_index_zone
            volume
        }
    }]
}

/api/v1/workout/[id]/score/

Returns workout score for individual muscles and muscle groups

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
score{
    muscles{
        name{
            score
        }
    }
    groups{
        name{
            score
        }
    }
}

/api/v1/routineinstance/[routine_instance_id]/exercises/

Returns all activities that the user has done based on the given activity sequence.

Args

api_sid
api_secret
auth_token
activity_sequence_numbers (csv list)

Returns

status
errors[]
activities[{
    activity_sequence
    routine_instance_id
    start_time
    end_time
    start_time_raw
    end_time_raw
    exercise{
        id
        name
    }
    reps
    weight
    weight_units
    one_rep_max
}]

/api/v1/routineinstance/[routine_instance_id]/hr/

Get the user's raw HR data for a give routine instance

Args

api_sid
api_secret
auth_token

Returns

status
errors[]
hr_data[]
routine_instance_id

/api/v1/workouts/month/

Returns status of "ok" on success and "failed" on error.

Args

api_sid
api_secret
auth_token
tz_offset : int (timezone offset from UTC)
year [default: current]
user_id : int (for PT and ADMIN use only)

Returns

status
errors[]
months{}
active_years[]

/api/v1/workouts/month-list/

Returns status of "ok" on success and "failed" on error. List version,
meaning it returns days in list format instead of dict. Returns two
months per page, defaults to most recent two months.

Args

api_sid
api_secret
auth_token
tz_offset : int (timezone offset from UTC)
page [default: 0]

Returns

status
errors[]
months{}

/api/v1/workouts/day/

Returns status of "ok" on success and "failed" on error.

Args

api_sid
api_secret
auth_token
tz_offset : int (timezone offset from UTC)
year [default: current]
month [default: current]
day [default: current]

Returns

status
errors[]
routine_instances[]

/api/v1/all-activity/month-list/

Returns status of "ok" on success and "failed" on error. Returns ALL activity
including daily activity (steps), sleep, and workouts Returns days in list 
format instead of dict. Returns two months per page, defaults to most recent 
two months. Contains ability to filter, defaults to show all.

Args

api_sid
api_secret
auth_token
tz_offset : int (timezone offset from UTC)
page [default: 0]
filters{
    routines: boolean [default: true]
    activity: boolean [default: true]
}

Returns

status
errors[]
months{}