Releasesv0.1.0
Api referenceEndpointsAdmin

Workouts (instance admin, one tenant)

GET
/v1/admin/tenants/{tenant_id}/users/{id}/workouts

GET /v1/users/{id}/workouts (listWorkouts) for the tenant of tenant_id, read with an instance admin key: the same parameters and the same answer as the tenant's own key gets. Read only. Recorded in the caller's audit log and, actor admin, in the tenant's. See docs/admin-api.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid
id*string
Formatuuid

Query Parameters

type?string

Canonical activity type (running, cycling...); all when absent.

start?|

Inclusive lower bound, RFC 3339 or YYYY-MM-DD.

end?|

Exclusive upper bound, RFC 3339 or YYYY-MM-DD. Must not be before start.

view?string

merged (the default): when several sources recorded the same thing (a ring and a watch the same night, a phone and a watch the same steps, one sample directly and through an aggregator), only the best ranked source's record is listed, so nothing counts twice. The order of sources is the user's (see source-priorities). all: every stored record of every source.

Default"merged"
Value in"merged""all"
cursor?string

The next_cursor of the previous page.

limit?integer
Range1 <= value <= 1000
Default100

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

One page, by start_date.

application/json
  1. response
data*array<>
next_cursor*|

Null on the last page.

curl -X GET 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/workouts' \  -H 'Authorization: Bearer ohs_sk_...'
{  "next_cursor": "string",  "data": [    {      "provider": "string",      "source": "string",      "device": "string",      "ingested_at": "2019-08-24T14:15:22Z",      "id": 0,      "activity_type": "running",      "start_date": "2019-08-24T14:15:22Z",      "end_date": "2019-08-24T14:15:22Z",      "duration_s": 0,      "active_energy_kcal": 0,      "distance_m": 0,      "avg_heart_rate": 0,      "max_heart_rate": 0,      "avg_speed_mps": 0,      "elevation_gain_m": 0,      "vo2_max": 0,      "external_id": "string",      "metadata": {}    }  ]}
Edit on GitHub