Releasesv0.1.0
Read data

What has landed, per provider and day, and what is still processing

GET
/v1/users/{id}/coverage

Record counts per provider per local day, and pending_jobs, the user's work not finished yet: ETL jobs and provider pulls. After an upload or a provider connection, poll until pending_jobs is 0 to know every part and every queued pull has been processed; then rejected_records above 0 means some lines were not stored. Not paged: at most 10000 days are returned, the earliest, and truncated is true when more matched (narrow start and end). start and end compare as dates.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid

Query Parameters

provider?string
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"

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

Coverage report.

application/json
  1. response
pending_jobs*integer

Work of the user not finished yet: ETL jobs and provider pulls (backfill, scheduled or notified), pending or running. A pull that keeps failing stays pending while it retries; GET /v1/users/{id}/freshness says why.

parked_jobs*integer

ETL jobs that exhausted their retries (an operator must look).

rejected_records*integer

Lines of the user the ETL could not store (bad value, missing field, unknown unit) and has not recovered since, each line once; an object that failed as a whole counts as one. Counts every provider and day, whatever the filters.

truncated*boolean

True when more than 10000 days matched; days holds the earliest.

days*array<>
curl -X GET 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/coverage' \  -H 'Authorization: Bearer ohs_sk_...'
{  "pending_jobs": 0,  "parked_jobs": 0,  "rejected_records": 0,  "truncated": true,  "days": [    {      "provider": "string",      "date": "2019-08-24",      "records": 0,      "metrics": {        "property1": 0,        "property2": 0      },      "last_synced_at": "2019-08-24T14:15:22Z"    }  ]}
Edit on GitHub