Clinked

Clinked only lets you create an OAuth client through the API. This explains how to generate the OAuth client ID and secret.


Commands used

These examples use the uuid and jq utility linux commands. uuid simply generates a GUID and jq outputs JSON in a neater format.

Either:

1) install these:

sudo apt install uuid
sudo apt install jq

or

2) omit the piping to jq and generate your own GUID.

Generate a token using an admin user's credentials

In the command below substitute <USERNAME> and <PASSWORD> for the username and password of a Clinked administrator.

curl 'https://api-p1.clinked.com/oauth/token?client_id=clinked-mobile&grant_type=password&username=<USERNAME>&password=<PASSWORD>&code=12345' -H 'Accept: application/json'

This returns some JSON:

{
"access_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"token_type": "bearer",
"refresh_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"scope": "read write"
}

Take a copy of the contents of access_token.

Create a new OAuth client in Clinked

Substitute <ACCESS_TOKEN> for the access token you received:

deviceToken=uuid
curl 'https://api-p1.clinked.com/v2/applications' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Bearer <ACCCESS_TOKEN>' -d '{ "deviceType" : "Other","appVersion" : "1.0","deviceOs" : "Other","name" : "Trelica","bundleId" : "com.trelica","description" : "Trelica","deviceModel" : "Trelica","platform" : "OTHER","deviceToken" : "${deviceToken}" }' | jq

This should return a long piece of JSON. Read through it and find the clientId and clientSecret attributes:

"clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Paste the values for these attributes into Trelica when you connect Clinked.\

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.