Wearables

Change a wearable provider

  • Sandbox: available
  • Staging: available
  • Production: unknown
PATCH
/v1/wearables/providers/{provider}

Changes a wearable provider your project has already set up: its client ID, its secret, Suunto's subscription key or notification secret, or whether patients may connect it.

Auth: bearer token of a project admin. Scope: the caller's project (from the token).

Behaviour

  • Send at least one of clientId, secret, subscriptionKey, webhookSecret and enabled. Fields you leave out keep their value.
  • webhookSecret is Suunto's notification secret; change it here when you change it in the Suunto portal. Other providers answer 422 WEBHOOK_SECRET_NOT_USED.
  • Changing Suunto's clientId keeps its webhookSecret. Send a new one in the same request if the new app signs with another secret. A secret the provider issued, like Polar's, belongs to its client and is replaced on a client change.
  • enabled: false stops new connections. Patients already connected stay connected and can still disconnect.
  • A provider not set up answers 404 PROVIDER_NOT_CONFIGURED; set it up with POST.
  • Changing Withings' clientId to the one of ovok's own Withings device integration answers 422 CLIENT_ID_RESERVED.
  • Changing Withings' secret keeps its webhookUrl: the URL's token comes from a secret ovok makes for the project, not from the client secret. Changing its clientId makes a new token, and so a new URL; patients connect again to the new app anyway.
  • For Polar, every change with enabled: true sets the webhook up again as POST does. enabled: false leaves the webhook in place; its notifications answer 404 until you switch Polar back on.

Example

curl -X PATCH 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' \  -d '{ "enabled": false }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

provider*string
Value in"oura""whoop""strava""withings""polar""suunto""garmin""ultrahuman"

Request Body

application/json
  1. body
clientId?string

The OAuth client ID of the project's app at the provider.

Length1 <= length <= 500
secret?string

The OAuth client secret. Never returned.

Length1 <= length <= 2000
subscriptionKey?string

Suunto only: the app's API-management subscription key. Never returned.

Length1 <= length <= 2000
webhookSecret?string

Suunto only: the notification secret set in Suunto's portal, to check its notifications. Never returned.

Length1 <= length <= 2000
enabled?boolean

Whether the project's users may connect this provider.

Response Body

The provider after the change.

application/json
  1. response
provider*string
Value in"oura""whoop""strava""withings""polar""suunto""garmin""ultrahuman"
configured*boolean

Whether the project holds credentials for this provider.

enabled*boolean

Whether its users may connect it: configured and switched on.

clientId*string

The OAuth client ID, or null when not configured.

redirectUri*string

The callback URL to register in the provider's developer portal; null when this server has no APP_BASE_URL.

webhookUrl*string

Where the provider sends notifications, to paste in its developer portal where it asks for one. Withings' ends in a per-project token, so it is shown to admins only. Null when the provider sends none, is not set up, its webhook secret is not stored yet, or this server has no APP_BASE_URL.

webhookReady*boolean

Whether ovok holds the secret that checks this provider's notifications, so they are accepted: Polar's signing key from its webhook setup, Withings' generated URL secret, or the Suunto secret the admin sent. False until then, such as after a failed Polar webhook setup. Null when the provider sends no notifications.

Example Request
curl -X PATCH 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "provider": "oura",  "configured": true,  "enabled": true,  "clientId": "string",  "redirectUri": "string",  "webhookUrl": "string",  "webhookReady": true}