Import Workouts
POST https://api.runningahead.com/rest/logs/me/workouts/{type}
Import workouts from an external data source.
Request
Parameter |
Type |
Description |
access_token |
string (required) |
OAuth 2.0 token for the current user. |
File Types
The API currently supports the following file types. To specify the file
type, replace {type}
place holder with one of these types:
Type |
Description |
fit |
The ANT Fit file format. |
gpx |
The GPX file format. The API accepts GPX versions 1.0 and 1.1. |
tcx |
The Garmin Training Center data file. |
Request Body
Specify the content of the data file to be imported in the POST body. It is
highly recommended that you compress the data to reduce bandwidth usage and
thus speed up the upload. The API supports GZIP compression. If you
compressed the data, you need to include the HTTP header
"Content-Encoding: gzip
".
Response
Parameter |
Type |
Description |
ids |
string [ ] |
If the import is successful, Import Workouts will return a list of
workout IDs representing the imported workouts. |
Example
To upload a GPX file, POST to the following endpoint:
https://api.runningahead.com/rest/logs/me/workouts/gpx?access_token=VjU5s4dyhAPO2XiUzaNVeE
Response
{
ids:
[
"62106e514f794dd3b19fbf9a1bd13a45"
]
}