Notification Service
The user should subscribe to the notification server to receive notifications. Iris Notification Manager (ntm) is the server provided by Iris platform for notification subscription. On request to ntm server for notification service , the user must specify which service should be used, GCM or XMPP.
Register a Subscriber
The request must specify the protocol to be used and pass the token accordingly, along with Iris token received in response from Auth Manager during login process.
Using GCM Protocol
Device_Token is an ID issued by the GCM connection servers to the client app that allows it to receive messages.
Request :
HTTP POST https://ntm.iris.comcast.net/v1/subscriber http/1.1
Headers:
Content-Type: application/x-www-form-urlencoded
User-Agent: <App name>/<App version><space><System http agent>
Authorization: Bearer <Iris token>
Requestbody:
{"proto":"gcm","token":"<deviceToken>","app_domain":"<app domain>"}
On successful invocation, notification server will issue a subscriber Id.
Response:
Status Code: 200 OK
Headers:
Content-Type: application/json
Trace-Id: <ntm traceId>
Responsebody:
"id": "<subscriberId>"
Using XMPP Protocol
Request :
HTTP POST https://ntm.iris.comcast.net/v1/subscriber
Headers:
Content-Type: application/x-www-form-urlencoded
User-Agent: App name>/<App version><space><System http agent>
Authorization: Bearer <Iris token>
Requestbody:
{"proto":"xmpp", "token":"<routingId of registered user>", "app_domain":"<app domain>"}
On successful invocation, notification server will issue a subscriber Id.
Response:
Status Code: 200 OK
Headers:
Content-Type: application/json
Trace-Id: NTM-0ac12501-39bc-11e9-af32-fa163eff856b
Vary = Origin
Response.body :
{"id": "<subscriberId>"}
Request Subscription for Topics
The user can subscribe to multiple topics. Even if the user is already registered for a topic, the request will still be successful. The user will receive 200 OK as response for a successful request. Iris user can subscribe to the following topics:
Subscribe for Video Call Notification
In order to receive incoming call notifications for video call, user should request the ntm server with the following content:
Request :
HTTP POST https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/<app domain>/video/<routing id with double encoded strings>
Headers :
Content-Type : application/json
User-Agent : App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
Subscribe for PSTN Call Notification
In order to receive incoming call notifications for PSTN call, user should request the ntm server with the following content:
Request :
HTTP POST https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/federation/pstn/<routing id>
Headers :
Content-Type : application/json
User-Agent : App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
Subscribe for Chat Notification
In order to receive notifications for chat messages, user should request the ntm server with the following content:
Request :
HTTP POST https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/<app domain>/chat/<routing id>
Headers :
Content-Type : application/json
User-Agent : App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
Deregister a Subscriber
User can deregister a subscriber in the following cases:
- Stop receiving incoming notification
- While logging out
- Stop using a specific subscriber and to use the other one. eg: When the app is subscribed to GCM and want to use XMPP to receive notification, it should deregister GCM subscription before registering to XMPP
Request:
HTTP DELETE https://ntm.iris.comcast.net/v1/subscriber/<subscriber id>
Headers :
User-Agent : App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
User will receive a 200 OK response when the current subscription get revoked. To reuse notification service, user should again sent a registration request.
Deregister Subscription for Topics
The user can revoke subscription to a topic, to stop receiving incoming notification. 200 OK response will be received, when the current topic subscription get revoked. To receive notification again, user should send a subscription request for topics.
Deregister Video Call Subscription
User will not receive video call notifications, once the request for revoking subscription is successfully executed.
Request:
HTTP DELETE https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/<app domain>/video/<routing id>
Headers :
User-Agent : <App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
Deregister PSTN Call Subscription
User won't be able to receive pstn call notification once the request for revoking subscription is successfully executed.
Request:
HTTP DELETE https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/<app domain>/federation/pstn/<routing id>
Headers :
User-Agent : <App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>
Deregister Chat Subscription
User won't be able to receive chat notification once the request for revoking subscription is successfully executed.
Request:
HTTP DELETE https://ntm.iris.comcast.net/v1/subscription/subscriber/<subscriber id>/topic/<app domain>/chat/<routing id>
Headers :
User-Agent : <App name>/<App version><space><System http agent>
Authorization : Bearer <Iris token>