SportTracks REST API: Activities

Get Workout List

You can retrieve a list of workouts by sending an HTTP GET request to this URL:

https://api.sporttracks.mobi/api/v2/fitnessActivities

If successful, the method returns a JSON encoded workout list object.

This method can be used to retrieve all private workouts for the authenticated user.

Parameters

Param Description
pageSize Number of results to return. Defaults to 25.
page Which page of results to return. Defaults to 0.
noEarlierThan If specified limits the date range of results returned.
noLaterThan If specified limits the date range of results returned.

Get Workout Details

You can retrieve details for a specific workout by sending an HTTP GET request to this URL:

https://api.sporttracks.mobi/api/v2/fitnessActivities/{id}

If successful, the method returns a JSON encoded workout object.

This method can be used to retrieve private workouts of the authenticated user.

Add Workout

You can create a workout by sending an HTTP POST request to this URL:

https://api.sporttracks.mobi/api/v2/fitnessActivities

The POST data must contain a JSON encoded workout object. All fields are optional except start_time.

If successful, the method returns a URI which can be used to get details about the added workout.

Update Workout

You can update a workout by sending an HTTP PUT request to this URL:

https://api.sporttracks.mobi/api/v2/fitnessActivities/{id}

The POST data must contain a JSON encoded workout object which entirely replaces the existing workout. All fields are optional except start_time.

If successful, the method returns a URI which can be used to get details about the added workout.

Delete Workout

You can create a workout by sending an HTTP DELETE request to this URL:

https://api.sporttracks.mobi/api/v2/fitnessActivities/{id}

If successful, the method returns a JSON object with a status property = ok.

Uploading a FIT, TCX or GPX file

You can import a file by sending an HTTP POST request to this URL:

https://api.sporttracks.mobi/api/v2/fileUpload

The POST data must contain two parameters:

  • format: "GPX" | "TCX" | "FIT"
  • data: The data

If passing a FIT file it must be base64 encoded

The call returns a JSON object:

{
   fitnessActivities: {
      size: 1,
      uris: [
         "https://api.sporttracks.mobi/api/v2/fitnessActivity/123456"
      ]
   }
}