question

Greg Rossi avatar image
Greg Rossi asked Phong Vu answered

subscription expiry with PubNub transport

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.

rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered

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

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys