Notification Service
The user should subscribe to the notification server to receive notifications. The 555 Notification manager (ntm) is the server provided by 555 platform for notification subscription. Notifications are delivered via SDK callbacks which will be explained later section.
Create a Subscriber
To create a subscriber in 555 NTM. The request must specify the protocol
to be used along with 555 JWT token received in response from Auth Manager during the login process.
This API allows subscribers to register. This API is idempotent - if the API is called with the same set of inputs, the same subscriber ID will be returned
The app can use the routing id of the registered user as the token to request for XMPP notification service.
curl -X POST -H "Content-Type: application/json"
-H "Authorization: Bearer <555 JWT Token>"
-d '{"app_domain": "<App Domain>", "proto": "xmpp", "token":"<Routing Id of the user>"}'
https://<NTM_URL>/v1/subscriber
On successful invocation, notification server will issue a subscriber Id Ex.:
"{\"id\":\"5cd9cb3080449162c4e779ss\"}"
Creating Subscription for Topics
Application are expected to build topic strings for managing both publish and subscription. The user can subscribe to multiple topics. Even if the user is already registered for a topic, the request will still be successful. 200
will be the response for the successful topic subscription request. 555 user can subscribe to the following topics:
Subscribe for Video Call Notification
A topic of subscription is a URL encoded string of app domain, subscriber Id from previous v1/subscriber
call and subscription topic is string ex. video, pstn, audio. Here for video call use video
For video call topic will look like below :
var topic = encodeURIComponent(<App Domain> + "/" + video + "/" + <routingId>)
In order to receive incoming call notifications for video call, the user should request the ntm server with the following content and response would be 200.
curl -X POST -H "Content-Type: application/json"
-H "Authorization: Bearer <555 JWT Token>"
-d '{"id": "<subscriber id>", "topic": "<topic>"}'
https://<NTM_URL>/v1/subscription/subscriber/<subscriberId>/topic/<topic>
Subscribe for PSTN Call Notification
Subscription topic for PSTN call is pstn
, topic for http request is built as below
var topic = encodeURIComponent("federation/" + pstn + "/" + <routing id>);
In order to receive incoming call notifications for PSTN call, the user should request the ntm server with the following content:
curl -X POST -H "Content-Type: application/json"
-H "Authorization: Bearer <555 JWT Token>"
-d '{"id": "<subscriber id>", "topic": "<topic>"}'
https://<NTM_URL>/v1/subscription/subscriber/<subscriberId>/topic/<topic>
Subscribe for Chat Notification
Subscription topic for chat is chat
, topic for http request is built as
var topic = encodeURIComponent(<App Domain> + "/" + chat + "/" + <routingId>)
In order to receive incoming message notifications, the user should request the ntm server with the following content:
curl -X POST -H "Content-Type: application/json"
-H "Authorization: Bearer <555 JWT Token>"
-d '{"id": "<subscriber id>", "topic": "<topic>"}'
https://<NTM_URL>/v1/subscription/subscriber/<subscriberId>/topic/<topic>
Deleteing a Subscriber
When client wishes to stop listening for notifications, such as when user signs out of the app, the application can delete the subscriber thereby purging all subscriptions in one API call.
curl -X DELETE -H "Authorization: Bearer <555 JWT Token>"
https://<NTM_URL>/v1/subscriber/<subscriber id>
User will receive a 200
response when the current subscription gets revoked. To reuse notification service, the user should again sent a registration request.
Cancelling Subscription for Topics
When a client wishes to unsubscribe from an event, such as when a user toggles notification OFF for lets say video call, client can DELETE the topic subscription using following API.
Cancelling Video Call Subscription
The user will not receive video call notifications, once the request for revoking subscription is successfully executed. Topic :
var topic = encodeURIComponent(<App Domain> + "/" + video + "/" + <routingId>)
curl -X DELETE -H "Authorization: Bearer <555 JWT Token>"
https://<NTM_URL>/v1/subscription/subscriber/<subscriber id>/topic/<encoded topic>
Cancelling PSTN Call Subscription
The user will not receive pstn call notification once the request for revoking subscription is successfully executed.
var topic = encodeURIComponent("federation/" + pstn + "/" + <routing id>);
curl -X DELETE -H "Authorization: Bearer <555 JWT Token>"
https://<NTM_URL>/v1/subscription/subscriber/<subscriber id>/topic/<encoded topic>
Cancelling Chat Subscription
The user will not receive chat notification once the request for revoking subscription is successfully executed.
var topic = encodeURIComponent(<App Domain> + "/" + chat + "/" + <routingId>)
curl -X DELETE -H "Authorization: Bearer <555 JWT Token>"
https://<NTM_URL>/v1/subscription/subscriber/<subscriber id>/topic/<encoded topic>