To optimize API integration offered by OPTT, we introduce the webhook which simplifies the access for third-party digital mental health applications to any notifications received inside the OPTT platform without the need to login into OPTT platform. This will simplify and enhance 3rd party user experience to use the clinically validated smart care plans.
In this guide you will learn how to connect to OPTT Notification Center and receive notifications from OPTT on your android application via Webhook:
1- Registering the Application in the Firebase
Client (Android application) registers itself in FCM using the OPTT Server Key and gets a specific token by adding the Firebase SDK to the app.
2- Registering the Application in OPTT
The client sends the token that was generated by Firebase SDK along with the OPTT.ID (in this case user’s email address) to the notification server and gets registered to the notification system.
3- Registering user’s application in OPTT
The client, registers the users to the FCM and gets the token, then sends back the OPTT.ID and the token (that was already sent by FCM) to OPTT for registering the user in the OPTT notification service.
3.1- Request URL:
"userId": "[email protected]"
In this call, we want to register [email protected]:
4- Sending Notifications Through OPTT
From now on, users will receive OPTT notifications. Any new notification that is created for the user will be sent to them.
5- Testing the Receiving of Notifications for Registered Users:
Consider that a user has logged in to the application using: [email protected]
And the client has already created a token for this user through Firebase and has sent the token along with the user's email address to OPTT.
From now on, all new notifications will be sent to the user.
5.1- Request URL:
|content of notification
|Notification deep link address in the application
|subject of notification
6- Receiving Notifications by the User
Updated about 2 years ago