Skip to main content
Question

subscription expiry with PubNub transport

  • 19 July 2021
  • 1 reply
  • 205 views

The API reference for /subscription states that expiresIn has a max value of 7 days (greater for webhooks). However, if I attempt to create a subscription with a one-hour lifetime, a 15-minute subscription is created. Is there a different undocumented expiresIn maximum for PubNub?

Request:
curl --request POST 
--url https://platform.ringcentral.com/restapi/v1.0/subscription
--header 'accept: application/json'
--header 'authorization: Bearer ...
--header 'content-type: application/json'
--data '{"deliveryMode":{"transportType":"PubNub"},"eventFilters":["/restapi/v1.0/account/~/telephony/sessions"],"expiresIn":3600}'

Response:

{
"uri": "https://platform.ringcentral.com/restapi/v1.0/subscription/5c2a73a6-4320-4a3f-ac3d-a9c7b86f10dc",
"id": "5c2a73a6-4320-4a3f-ac3d-a9c7b86f10dc",
"creationTime": "2021-07-19T18:07:21.411Z",
"status": "Active",
"eventFilters": [
"/restapi/v1.0/account/66958521/telephony/sessions"
],
"expirationTime": "2021-07-19T18:22:21.411Z",
"expiresIn": 899,
"deliveryMode": {
"transportType": "PubNub",
"encryption": false,
"address": "474144630900267_cXXXXXXX",
"subscriberKey": "sub-c-b8b9cd8c-e906-11e2-b383-02ee2XXXXXXX"
}
}

Is it possible to create a subscription with a longer expiry, e.g., up to 24 hours? A 15 minute maximum makes it nearly impossible to guard against data loss during ordinary system downtime/maintenance.

1 reply

Userlevel 2
Badge

PubNub notification expires after 15 mins. That is the maximum value. You must implement a timer to renew the subscription before it expires.

https://developers.ringcentral.com/api-reference/Subscriptions/renewSubscription

Reply