Some changes to the endpoints that create/update workouts on the calendar and in folders:
- The workout description is now parsed. This means that workouts created or updated via the API have training load calculated and get “time in zones” and so on. This also applies to workouts synced from an external calendar.
- You can now create/update workouts from zwo, mrc and erg files.
POST /api/v1/athlete/{id}/events
{
"category": "WORKOUT",
"start_date_local": "2021-04-29T00:00:00",
"type": "Ride",
"filename": "4x8m.zwo",
"file_contents": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<workout_file>..."
}
Response:
{
"id": 610062,
"icu_training_load": 116,
...
"name": "4x8m VO2 Max",
"description": "These are horribly nasty.\nCategory: Horrible\n\n- 20m 60% 90-100rpm\n\nMain set 4x\n- 8m 110%\n- 8m 50%\n\n- 10m 60%\n",
...
"workout_doc": {
"steps": [
{
"power": {"units": "%ftp", "value": 60},
"cadence": {"end": 100, "start": 90, "units": "rpm"}, "duration": 1200
}, ...
],
"duration": 5640,
"zoneTimes": [1920, 1800, 0, 0, 1920, 0, 0, 0],
"hrZoneTimes": [1920, 1800, 0, 0, 1920, 0, 0, 0]
},
"icu_intensity": 86.04798
}