Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Use these use-cases (with curl language examples) as a guide for your app development.

API Credentials

For all use-cases, you should have the following information (the following values are examples only):

...

Obtain the access-token by following the steps below.

API call

Code Block
breakoutModewide
$ curl --request POST 'https://api.sondeservices.com/platform/v1/oauth2/token' \
--header 'Authorization: Basic <Base64EncodedString>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=sonde-platform/users.write sonde-platform/scores.write sonde-platform/storage.write'

...

Code Block
$ echo -n "<clientid>:<clientsecret>" | openssl base64 -A

API response

Code Block
{
  "access_token": "ya29.QQIBibTwvKkE39hY8mdkT_mXZoRh7Ub9cK9hNsqrxem4QJ6sQa36VHfyuBe",
  "expire_in": 3600,
  "token_type": "Bearer"
}

...

Example; if you want your device to upload a voice sample to the Sonde Platform using Storage Service, then you can share an access-token with the device having scope sonde-platform/storage.write to restrict the access and prevent the misuse of privileges your client-credential is carrying.

As a developer, I want to generate

...

a Depressive Symptoms Risk score.

Score Depressive Symptoms Risk health condition with the Sonde Platform “Depressive Symptoms Risk” measure.

...

countryCode should be the country information which you have used while creating the account with Sonde Health (account creation is manual at this moment).

Replace <userIdentifier> with the value of the userIdentifier attribute of Response2

...