Reputation: 21
I have set RC object to auto refresh the token, and subscribed to the detailedtelephony event to get incoming call notifcation. I have also subscribed to autorefresh event of RC object to get the refreshed token and assigned it to global RC object.This works fine. I would like to know if the token gets refreshed after every hour or so, do we need to subscribe to the detailedtelephony event again i.e. everytime token get refreshed?
Upvotes: 1
Views: 212
Reputation: 211
You don't need to subscribe again for RingCentral push notification events (including the detailedtelephony) after refreshing your RC object access token. It is for you to access the platform.
However, the push notification subscription will expire regardless of the access/refresh token.
"expiresIn": 500000000
for just over 15 years so you don't have to worry about renewal.This is how you should implement in your app:
expiresIn
or the expirationTime
.expiresIn
(seconds) to call the renew endpoint. (you need the valid access token to call this endpoint though)expirationTime
(remember to convert the time zone to your local time) then call the renew endpoint when your timer fires off. (you need the valid access token to call this endpoint though)You can see an example of a long-lived token in the bot documentation here:
https://ringcentral-api-docs.readthedocs.io/en/latest/glip_bots/
Upvotes: 1