Change a wearable provider
- Sandbox: available
- Staging: available
- Production: unknown
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,webhookSecretandenabled. Fields you leave out keep their value. webhookSecretis Suunto's notification secret; change it here when you change it in the Suunto portal. Other providers answer422 WEBHOOK_SECRET_NOT_USED.- Changing Suunto's
clientIdkeeps itswebhookSecret. 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: falsestops new connections. Patients already connected stay connected and can still disconnect.- A provider not set up answers
404 PROVIDER_NOT_CONFIGURED; set it up withPOST. - Changing Withings'
clientIdto the one of ovok's own Withings device integration answers422 CLIENT_ID_RESERVED. - Changing Withings'
secretkeeps itswebhookUrl: the URL's token comes from a secret ovok makes for the project, not from the client secret. Changing itsclientIdmakes a new token, and so a new URL; patients connect again to the new app anyway. - For Polar, every change with
enabled: truesets the webhook up again asPOSTdoes.enabled: falseleaves the webhook in place; its notifications answer404until 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 }'bearerAuthorizationBearer <JWT>provider*string"oura""whoop""strava""withings""polar""suunto""garmin""ultrahuman"application/json- body
clientId?stringThe OAuth client ID of the project's app at the provider.
1 <= length <= 500secret?stringThe OAuth client secret. Never returned.
1 <= length <= 2000subscriptionKey?stringSuunto only: the app's API-management subscription key. Never returned.
1 <= length <= 2000webhookSecret?stringSuunto only: the notification secret set in Suunto's portal, to check its notifications. Never returned.
1 <= length <= 2000enabled?booleanWhether the project's users may connect this provider.
The provider after the change.
application/json- response
provider*string"oura""whoop""strava""withings""polar""suunto""garmin""ultrahuman"configured*booleanWhether the project holds credentials for this provider.
enabled*booleanWhether its users may connect it: configured and switched on.
clientId*stringThe OAuth client ID, or null when not configured.
redirectUri*stringThe callback URL to register in the provider's developer portal; null when this server has no APP_BASE_URL.
webhookUrl*stringWhere 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*booleanWhether 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.
curl -X PATCH 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \ -H 'Content-Type: application/json' \ -d '{}'{ "provider": "oura", "configured": true, "enabled": true, "clientId": "string", "redirectUri": "string", "webhookUrl": "string", "webhookReady": true}Get a wearable provider GET
Returns one wearable provider of your current project, set up or not, in the shape of `GET /v1/wearables/providers`. It never returns a secret. **Auth:** bearer token of a project admin. **Scope:** the caller's project (from the token). ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Remove a wearable provider DELETE
Removes your project's credentials for a wearable provider. **Auth:** bearer token of a project admin. **Scope:** the caller's project (from the token). ## Behaviour - Patients can no longer connect the provider. - Patients already connected keep their connection until they disconnect it. - For Polar, ovok also deletes the client's webhook at Polar when it points at this project's `webhookUrl`; a webhook pointing anywhere else is left alone. Should that fail, the credentials are removed all the same. - A provider not set up answers `404 PROVIDER_NOT_CONFIGURED`. ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/v1/wearables/providers/oura' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```