Generating the token for application that use identity provider

How to get authorization via OAuth Access Tokens to call OPTT project API in your application.

If your IOS or Android application authorized users by an identity provider, you should follow these steps to getting an organization token:

📘

In General:

1- The 3rd party embeds the OPTT dashboard in their app.

2- OPTT generates “OPTT_Client_Code” and “OPTT_Secret_Code”, Grant_type for 3rd party, which are unique codes that 3rd party must use for requests.

695

Step 1:

How to get token:

1155

API Inputs:

ParameterDescription
client_idThis is your company-specific code generated by OPTT
client_SecretThis is your company-specific code generated by OPTT
codeGet it from the identity provider by sending the client code and client secret
user_typeCLIENT
clinic_optt_idYour clinic ID in OPTT

📘

You can try it at the following link:
https://developers.optt.ca/v1.4/reference#gettokenbygoogleusingpost

Step 2:

you will receive the token and you should add this token to the end of the webview URL.

308

👍

Example:

https:// 3rd party.mobile.app.optt.ca/client/digital-session/detail/5682/RUNNING?lang=en/?token=eyJhY2Nlc3NfdG9rZW4i

This token expires every 5 minutes (expiration time can get changed).

Step 3

Keep in mind you can use the same API for receiving tokens for existing users. If a user exists we are not going to duplicate it.