Retrieve User's Training, Fitness and Status Information
Obtain a user’s current fitness and training information.
curl
-X GET "https://www.xertonline.com/oauth/training_info?format=zwo"
-H "Authorization: Bearer
7d3fc2e8cb80caffd881f08e764e1b507168cce4"
curl -X get "https://www.xertonline.com/oauth/workout-download/vovdxww5i7fzqbun.zwo" -H "Authorization:
Bearer 7d3fc2e8cb80caffd881f08e764e1b507168cce4"
Attributes
Sample Response
success:
Boolean Indicates that the request is successful/unsuccessful.
signature:
Object The user’s current fitness signature containing values for ftp, ltp, hie and pp representing Threshold Power, Lower Threshold Power, High Intensity Energy and Peak Power respectively.
status:
String The user’s current training status: Detraining, Very fresh, Fresh, Tired, Very tired representing the user’s current freshness status
weight:
Number The user’s weight in kilograms.
tl:
Object The user’s current training loads containing values for low, high, peak, total representing the training load for each individual system and the total.
targetXSS:
Object The user’s current training targets containing values for low, high, peak, total representing the training targets recommended by the system for each system and the total.
source:
String
The source of training information.
wotd:
Object The user’s workout-of-the-day information:
type:
Type of workout-of-the-day
None, Forecast, Scheduled representing No workout-of-the-day, workout-of-the-day was assigned to a Forecast AI training placeholder, workout-of-the-day was a planned workout.
name:
Name of the workout
workoutId:
Id of the workout
description:
Description text
difficulty:
Difficulty score
url:
URL of the workout file for the workout-of-the-day. Note that the URL will need to be requested with the user’s token.
Parameters
format:
String | optional
Value is erg or zwo and indicates the format of the workout file to be returned. If not provided, no workout file will be returned.
List default workouts - no authentication required.
curl -X GET "https://www.xertonline.com/oauth/workout"~> {"success":true,"workouts":[{"path":"MGLq16v2O6vrILBi","name":"Default Workout","description":"","last_modified":1457118394}]}⏎
List a user's workouts.
curl -X GET "https://www.xertonline.com/oauth/workouts" -H "Authorization: Bearer 7d3fc2e8cb80caffd881f08e764e1b507168cce4"~> {"success":true,"workouts":[{"path":"0GWegmcHSK6JKHth","name":"workout1","description":"Workout description","last_modified":1456263137},{"path":"ISm75NAmocJ7eUHr","name":"This is a workout","description":"Description goes here.","last_modified":1457025192}]}⏎
Retrieve a workout
Resolving a workout requires a specific user's fitness signature to calculate power values in watts, as well as interval durations, so a user's token is needed. Presently, the workout itself does not need to belong to the user whose token and signature are used.
The workout is specified by the path parameter given when obtaining a list of workouts. The parameter is added onto the request url.
The output's "workout" field is an array where each entry represents a set of similar intervals. Each set specifies the name of the interval to which it belongs, its index in the workout designer, as well as the target power in watts and set duration in seconds for both the work and rest interval. As in the above example, one set in the workout designer may be split into multiple set entries in this api call, depending on how mpa and time based intervals get resolved.
Getting Activities
Retrieve User's Activity.
The activity is specified by the path parameter given when obtaining activity details. The parameter is added onto the request url.
curl -X GET "https://www.xertonline.com/oauth/activity/MGLq16v2O6vrILBi?include_session_data=1" -H "Authorization: Bearer 7d3fc2e8cb80caffd881f08e764e1b507168cce4"
Attributes
Sample Response
success:
Boolean Indicates that the request is successful.
name:
Integer Name of the activity.
description:
String Description of the activity.
session_data:
Object Per second MPA data object.
summary:
Object Summary details of activity including XSS, XLSS, XHSS, XPSS, XEP, MEP, TWS, SP, SFD, Focus, Specificity, Activity Type, Activity Date, Signature, Difficulty Rating, Distance (km), Duration (minutes) Difficulty, Total grams of Carbs, Total grams of Fat and Street View Image
Parameters
id/path:
String | required The identifier of the activity.
include_session_data:
Integer | optional Values are 1 and 0, default is 0. Set to 1 to include session_data value from the response.
Retrieve User's Activity List.
Activity List are specified by a Date Range, "FROM" and "TO". The parameter is added onto the request url.
curl -X GET "https://www.xertonline.com/oauth/activity?from=1483230813&to=1506731613" -H "Authorization: Bearer 7d3fc2e8cb80caffd881f08e764e1b507168cce4"
Attributes
Sample Response
success:
Boolean Indicates that the request is successful.
activities:
Object Activity details including Name, Description, Activity Type, Start Date and Activity Path/ID
Parameters
from:
Integer, Timestamp | required A timestamp where the filtering of activities will Start.
to:
Integer, Timestamp | required A timestamp where the filtering of activities will End.
updated_from:
Integer, Timestamp | optional A timestamp where the filtering of activities will Start based on Updated Time.
Uploading .FIT file
The .FIT file needs to be posted to xertonline as multipart/form-data.
The 'name' parameter is optional, and sets the name of the activity. If omitted, the name of the .FIT file will be used.