Uploaded Workout File Data - TrainingPeaks/PartnersAPI GitHub Wiki

Uploaded Workout File Data

For File-Upload endpoint

Example:

Testing:
https://api.sandbox.trainingpeaks.com/v3/file

Production:
https://api.trainingpeaks.com/v3/file

Example:

{
    "UploadClient": "test application",
    "Filename": "2014-04-15-12-57-59.fit",
    "Data": "DhArAxU...",
    "Title": "Test Title",
    "Comment": "Test upload public API",
    "Type": "Swim",
    "WorkoutDay": "2020-01-31T00:00:00",
    "StartTime": "2020-01-31T17:59:59",
    "WorkoutId": 12345678
}

Data structure with the following fields:

  • UploadClient: string, required.
    • String identifying the client uploading the file. This is the name of your application or service.
  • Filename: string, required.
    • Original name of the file with file extension that identifies the type of file, such as "2014-05-19-15-07-22.fit"
    • The filename must not contain any of the following reserved characters: / \ ? % * : | " < > . or [space]
  • Data: string, required.
    • Base64 encoded file contents. GZipped files are supported to decrease size, especially for large XML format files.
    • Please see list of supported file format at this help page,
  • WorkoutDay: DateTime, optional.
    • Optional day of workout which overrides the date contained in the file.
    • Format: yyyy-MM-dd or yyyy-MM-ddT00:00:00 (ISO 8601)
  • StartTime: DateTime, optional.
    • Optional start time of the workout which overrides the start time contained in the file.
    • Format: yyyy-MM-dd HH:mm:ss or yyyy-MM-ddTHH:mm:ss (ISO 8601)
  • SetWorkoutPublic: boolean, optional.
  • Title: string, optional.
    • Optional title that will be used for the workout.
  • Comment: string, optional.
    • Optional comment that will be added to the workout as Post-Activity Comments.
  • Type: string, optional, case insensitive.
    • Optional sport type that the workout will be set to. When not provided, the type will be read from the file data. Supported types are: swim, bike, run, x-train, mtb, strength, xc-ski, rowing, walk, other.
  • WorkoutId: number, optional
    • Optional WorkoutId, if the uploaded file needs to be associated with specific planned incomplete workout.

Please refer to additional information on WorkoutDay and StartTime override