Releasesv0.1.0
Connections

How up to date each of the user's sources is

GET
/v1/users/{id}/freshness

One entry per provider connection, then one per device source (Apple Health) that uploaded, ordered by provider. synced_through is the end of the most recent window pulled (the time of the last upload for a device source) and lag_seconds is how far behind now it is. Providers that send notifications are pulled within seconds of a change; the regular pull is a backstop, every 6 hours while notifications arrive (push_healthy) and every hour otherwise. state is fresh, stale (behind by more than two pull intervals, or no upload for 26 hours), failing (the last 3 pulls failed, see last_error), syncing (first pull not done), needs_reauth or disconnected.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

Freshness of every source.

application/json
  1. response
as_of*string
Formatdate-time
data*array<>
curl -X GET 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/freshness' \  -H 'Authorization: Bearer ohs_sk_...'
{  "as_of": "2019-08-24T14:15:22Z",  "data": [    {      "provider": "string",      "kind": "oauth",      "status": "active",      "state": "fresh",      "synced_through": "2019-08-24T14:15:22Z",      "lag_seconds": 0,      "last_sync_at": "2019-08-24T14:15:22Z",      "last_event_at": "2019-08-24T14:15:22Z",      "push_healthy": true,      "pull_every_seconds": 0,      "next_pull_at": "2019-08-24T14:15:22Z",      "last_attempt_at": "2019-08-24T14:15:22Z",      "last_error": "string",      "consecutive_failures": 0,      "health": {        "healthy": true,        "reason": "needs_reauth",        "action": "reconnect",        "since": "2019-08-24T14:15:22Z",        "retry_at": "2019-08-24T14:15:22Z"      }    }  ]}
Edit on GitHub