Releasesv0.1.0
Connections

Create a link to the hosted connection page

POST
/v1/users/{id}/connect-sessions

Returns a link to a page served by Open Health Sync where the user picks a provider and goes through its consent, so your app needs no connection UI of its own. The token in the link is the page's only credential: send the link to this user only. It serves several providers until expires_at. After each consent the user lands on redirect_uri?status=connected|error&provider=<slug>, or, without redirect_uri, on the built-in result page, which links back to the connection page. See docs/connect-page.md.

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.

Request Body

application/json
  1. body
redirect_uri?string

Where the user lands after each consent. Absolute https URL (http only for localhost).

Formaturi
Lengthlength <= 2048
providers?array<string>

Provider slugs the page offers, in this order. Each must be an OAuth provider enabled on this instance. Default, every one.

Itemsitems <= 64
app_name?string

Shown as the page title.

Lengthlength <= 80
logo_url?string

An https image shown above the title.

Formaturi
Lengthlength <= 2048
ttl_seconds?integer
Range60 <= value <= 3600
Default1800

Response Body

The page link.

application/json
  1. response
url*string

<OHS_PUBLIC_URL>/connect?session=<token>

Formaturi
expires_at*string
Formatdate-time
curl -X POST 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/connect-sessions' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{}'
{  "url": "http://example.com",  "expires_at": "2019-08-24T14:15:22Z"}
Edit on GitHub