REST
Our REST API allows you to manage locations, groups, rooms and devices.
Root URL
https://care.core.api.livy.systems/b2b
Authentication
We use Auth0 for authentication. Contact us to receive a clientId and clientSecret. Use these credentials to acquire an M2M token from Auth0, then use that token to authenticate requests to our REST API.
A clientId is tied to a specific user and inherits access to all care homes and devices associated with that user.
Acquire M2M Token
Use curl to acquire an M2M token from Auth0:
curl \
--request POST \
--url https://livy-care-prod.eu.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{ "client_id":"<clientId>", "client_secret":"<clientSecret>", "audience":"https://care.core.api.livy.systems", "grant_type":"client_credentials", "scope": "<scope>" }'Replace <clientId> and <clientSecret> with the credentials you received from us.
scope is a space-separated list of permissions you want to request. The only valid scope for now is:
write:custom_device_data
Auth0 will respond with a JSON object like this:
{
"access_token": "<your-token-here>",
"scope": "write:custom_device_data",
"expires_in": 86400,
"token_type": "Bearer"
}access_tokenis the M2M token you will use to authenticate requests to our REST API.scopeis the list of permissions granted to the token.expires_inis the number of seconds until the token expires. After that, you will need to acquire a new token.token_typeis always “Bearer”.
Use M2M Token
For each request to our REST API, include the acquired M2M token in the Authorization header:
Authorization: Bearer <m2mToken>