Add the current user as a subscriber of Cloud Message (CM). This will allow the user to receive push notifications on the device. Note: Include subscriptionId or deviceId in the request body.

For information on how to receive Cloud Messages sent to your client application, see here

URL Parameters

None.

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
dataOnlyData only messages are not processed as push notifications by device, client app must process message data.booleanNofalse
subscriptionTypeCurrently only 'firebase' supported.stringNofirebase
subscriptionIdUnique identifier of the subscription.stringOnly if no deviceId
deviceIdUnique identifier of the device.stringOnly if no subscriptionId
scopeCategory of notifications to subscribe ('group', 'direct', 'all').arrayNoall
deviceTypeType of device ('browser', 'mobile').stringNo

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

OAuthAuthorizer

Example Request

URL

For Production: POST https://spacesapis.avayacloud.com/api/users/me/cm/subscriptions
For Staging: POST https://loganstagingapis.esna.com/api/users/me/cm/subscriptions

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Example Request Body

{
  "subscriptionId": "12344444444",
  "scope": ["all"]
}

Example Response

{
    "deviceId": "6d843bf3-ab98-49f5-9d34-23b4822bf05a",
    "dataOnly": false,
    "type": "firebase",
    "scope": [
        "all"
    ],
    "_id": "5ed15bad3e06483dd3848697",
    "subscriptionId": "12344444444",
    "__v": 0,
    "status": "adding",
    "uid": "user_5efc5417aa4a347af96de290",
    "userId": "5efc5417aa4a347af96de290",
    "userType": "user",
    "created": "2020-07-28T14:29:44.024Z",
    "id": "5ed15bad3e06483dd3848697"
}