Workout Of The Day Structured Workout File - TrainingPeaks/PartnersAPI GitHub Wiki

Structured Workout File Returns a structured workout file for the specified workout id in the specified format. The list of workout ids and valid formats for the workout are returned by the /v2/workouts/wod endpoint.

  • Resource endpoint: /v2/workouts/wod/file/{workout id}/?format={format}
  • HTTP Method: GET
  • OAuth Scope Required: workouts:wod
  • File formats: erg, fit, mrc, zwo, json

Points to note:

  • The endpoint /v2/workouts/wod/{date} will return a list of valid file formats, specific to that workout.
  • The workout MUST be structured.
  • Workouts without structure will return a 400 status code with the message: Workout has no structure
  • Workouts requested with an incorrect file type will return a 400 status code with the message: "Workout cannot be exported to format: '{format}'."

Example:

Testing:
https://api.sandbox.trainingpeaks.com/v2/workouts/wod/file/123456789/?format=mrc

Production:
https://api.trainingpeaks.com/v2/workouts/wod/file/123456789/?format=mrc

Returns:

The workout file in the body of the result, with the header value:
Content-Disposition: attachment; filename="filename.ext"

OR when the format is json see Workout Structure Object

*When the json format is selected, please make sure that athlete has threshold/zone settings for the given workout type.
*If your application need the notes for each workout step, choose json, mrc, erg, or zwo file format.