Note: This page has not yet been converted to the new developer portal format. Please use Swagger to test this API.
PubNub Subscriptions
PubNub Subscriptions API is
used to manage pubnub subscriptions within an organization. For details about PubNub, see
https://://www.pubnub.com/docs.
GET /cm/v1/subscrptions/init
Description
Initialize PubNub settings of an organization, the keys in the respons will be used
in other subscriptions APIs.
Parameters
Parameter | Position | Type | Optional | Description |
---|---|---|---|---|
organizationId | header | Long | n | The ID of the organization. |
Authorization | header | String | n | Basic authorization header. |
Response
HTTP Status Code | Response Body |
---|---|
200Ok | { “subKey”: “the subscription key”, “pubKey”: “the publish key”, “authKey: “the authorization key”, “expireDate”: 1606902148384 } |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden. No Permission for this Resource |
404 | Resource Not Found |
406 | Not Acceptable. Illegal Input. |
500 | Internal Error |
POST /cm/v1/subscrptions
Description
Subscribe resource channels.
Parameters
Parameter | Position | Type | Optional | Description |
---|---|---|---|---|
organizationId | header | Long | n | The ID of the organization. |
Authorization | header | String | n | Basic authorization header. |
subscriptionRequestWrapper | body | object | n | The subscription data. |
Request Body
CrisisSubscriptionRequestWrapper object
{
"authKey": "the authorization key",
"subscribeResources": [
{
"id": "5ed4a91b1424f211448c325b",
"subscribeResourceType": "CRISISEVENT"//
subscription resource type enum
},
{
"id": "5fc5f04a62e38468e7c9a5e9",
"subscribeResourceType": "CRISISTASKLIST"
}
]
}
Available Subscription Resource Types
Resource | Enum |
---|---|
Critical Event | CRISISEVENT |
Task List | CRISISTASKLIST |
Dashboard | CRISISDASHBOARD |
Tracker Survey | SURVEY |
Response
HTTP Status Code | Response Body |
---|---|
200Ok | Successfully subscribed resources: [ { "id": "5ed4a91b1424f211448c325b", "subscribeResourceType": "CRISISEVENT" }, { "id": "5fc5f04a62e38468e7c9a5e9", "subscribeResourceType": "CRISISTASKLIST" } ] |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden. No Permission for this Resource |
404 | Resource Not Found |
406 | Not Acceptable. Illegal Input. |
500 | Internal Error |
DELETE /cm/v1/subscrptions
Description
Unsubscribe resource channels.
Parameters
Parameter | Position | Type | Optional | Description |
---|---|---|---|---|
organizationId | header | Long | n | The ID of the organization. |
Authorization | header | String | n | Basic authorization header. |
subscriptionRequestWrapper | body | object | n | The subscription data. |
Request Body
CrisisSubscriptionRequestWrapper object
{
"authKey": "the authorization key",
"subscribeResources": [
{
"id": "5ed4a91b1424f211448c325b",
"subscribeResourceType": "CRISISEVENT"//
subscription resource type enum
},
{
"id": "5fc5f04a62e38468e7c9a5e9",
"subscribeResourceType": "CRISISTASKLIST"
}
]
}
"authKey": "the authorization key",
"subscribeResources": [
{
"id": "5ed4a91b1424f211448c325b",
"subscribeResourceType": "CRISISEVENT"//
subscription resource type enum
},
{
"id": "5fc5f04a62e38468e7c9a5e9",
"subscribeResourceType": "CRISISTASKLIST"
}
]
}
Available Subscription Resource Types
Resource | Enum |
---|---|
Critical Event | CRISISEVENT |
Task List | CRISISTASKLIST |
Dashboard | CRISISDASHBOARD |
Tracker Survey | SURVEY |
Response
HTTP Status Code | Response Body |
---|---|
200Ok | Successfully unsubscribed resources: [ { "id": "5ed4a91b1424f211448c325b", "subscribeResourceType": "CRISISEVENT" }, { "id": "5fc5f04a62e38468e7c9a5e9", "subscribeResourceType": "CRISISTASKLIST" } ] |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden. No Permission for this Resource |
404 | Resource Not Found |
406 | Not Acceptable. Illegal Input. |
500 | Internal Error |