Releasesv0.1.0
Connections

Sync a connection now

POST
/v1/users/{id}/connections/{provider}/sync

Queues a pull of the connection ahead of routine work and answers with the sync run; follow it at the Location header. The window ends now and starts where the connection's data ends (minus an hour of overlap), a day back for a connection that never synced, or at from (at most 30 days back). While a manual run of the connection is still queued or running, the answer is 200 with that run and nothing new is queued. 409 when the connection does not sync (needs_reauth, disconnected: connect the user again) or its provider is not enabled here.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid
provider*string

Connector slug, see GET /v1/providers.

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
from?string
Formatdate-time

Response Body

A manual run of this connection is already queued or running.

application/json
  1. response

One pull of one connection. status is queued, running, retrying (the last attempt failed, see error; the next is at next_attempt_at), rate_limited (the provider asked to wait until next_attempt_at), succeeded, failed (attempts spent, or the grant was refused) or cancelled (the connection was disconnected). objects_stored counts the raw provider payloads stored; the records written from them are announced by data.written webhooks.

id*integer
Formatint64
provider*string
trigger*string
Value in"backfill""scheduled""notification""manual"
status*string
Value in"queued""running""retrying""rate_limited""succeeded""failed""cancelled"
data_type*|

Set when a notification named the one data type to pull.

window_start*string
Formatdate-time
window_end*string
Formatdate-time
attempts*integer

Failed attempts so far.

objects_stored*integer|null
error*string|null
created_at*string
Formatdate-time
started_at*|
Formatdate-time
finished_at*|
Formatdate-time
next_attempt_at*|
Formatdate-time
curl -X POST 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/withings/sync' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{}'
{  "id": 0,  "provider": "string",  "trigger": "backfill",  "status": "queued",  "data_type": "string",  "window_start": "2019-08-24T14:15:22Z",  "window_end": "2019-08-24T14:15:22Z",  "attempts": 0,  "objects_stored": 0,  "error": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "next_attempt_at": "2019-08-24T14:15:22Z"}
Edit on GitHub