Statistics of one quantity type per hour or per local day (instance admin, one tenant)
GET /v1/users/{id}/samples/stats (sampleStats) 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.
tenantKeyAuthorizationBearer <token>Tenant API key, ohs_sk_ + 43 base62 characters.
tenant_id*stringThe id of a tenant; any other value is a 404.
uuidid*stringuuidtype*stringCanonical quantity type, as for listSamples.
interval?stringWidth of the intervals.
"day""hour""day"tz?stringIANA time zone of the intervals; a day runs from local midnight to local midnight.
"UTC"start*|Inclusive lower bound, RFC 3339 or YYYY-MM-DD (midnight in tz). Widened to a whole interval.
end*|Exclusive upper bound, RFC 3339 or YYYY-MM-DD (midnight in tz). Widened to a whole interval; at most 10000 intervals after start.
provider?stringKeep one provider.
view?stringmerged (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.
"merged""merged""all"The intervals that hold samples, by start, provider, source and unit.
application/json- response
type*stringinterval*string"hour""day"tz*stringview*string"merged""all"start*stringStart of the range after widening, with the offset of tz.
date-timeend*stringdate-timetruncated*booleanTrue when more than 50000 rows matched; buckets holds the earliest.
buckets*array<>curl -X GET 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/samples/stats?type=string&start=2019-08-24T14%3A15%3A22Z&end=2019-08-24T14%3A15%3A22Z' \ -H 'Authorization: Bearer ohs_sk_...'{ "type": "string", "interval": "hour", "tz": "string", "view": "merged", "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "truncated": true, "buckets": [ { "start": "2019-08-24T14:15:22Z", "provider": "string", "source": "string", "unit": "string", "count": 0, "sum": 0, "avg": 0, "min": 0, "max": 0 } ]}