GET /api/v1/users/{user_id}/events/workouts carries statistics such as heart rate, distance, calories and elevation gain. Each one is read in this order:
- The provider’s figure, when the provider sent one for that workout.
- Ours, computed by Open Wearables from the samples the same device recorded between the workout’s start and end, when the provider sent none. These are computed by the rollup, at most 15 minutes after the samples arrive.
null, when neither exists.
0 stays 0: it is the provider’s figure, not a missing one.
Calories
calories_kcal is the provider’s figure in the energy series the provider is known to report for workouts (total or active energy), else the provider’s figure whose series is not established yet, else the sum of the workout’s own active energy samples.
Totals and daily summaries
GET /api/v1/users/{user_id}/events/workouts/totals and the workout part of /summaries/activity (distance, energy, elevation) add up the same per-workout values: the provider’s for a workout where it sent one, ours where it did not.
Before this release the fields held only what the provider sent, and
null otherwise. A client that read null as “the provider sent no value” now receives the computed value in the same field.