Generating the Token

How we Generate OAuth tokens for 3rd party applications

This document explains how a 3rd party uses the OPTT dashboard:

OPTT allows third-party apps to embed the OPTT dashboard in their application.
For that, we enable the third party to use our token and allow their users to access their dashboard without any additional authorization, meaning that they don't have to use their username and password.

📘

In General:

1- The 3rd party embed 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.

315

Step1

3rd party must send the “3rd party_Client_Code”, along with the “OPTT_Client_Code”, “OPTT_Secret Code”, user type, and clinic email to OPTT by using the following API:

789 1154

API Input:

ParameterDescription
OPTT_Client_CodeOrganization Code
OPTT_Secret CodeOrganization Code
User_Id3rd party user-id
UsertypeCLIENT
Clinic_OPTT_IDClinic id in OPTT

📘

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

Step 2

OPTT sends a user-specific token to the 3rd party. 3rd party must use this token at the end of the OPTT URL to access the OPTT dashboard.

👍

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).

695 308

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.