question

Edmund Adjei avatar image
Edmund Adjei asked Edmund Adjei commented

How to test subscription reminder on the sandbox in UK

Hi,


I am working through this page https://developers.ringcentral.com/guide/notifications/webhooks/creating-webhooks using python code, I have subscribed to telephone sessions and a reminder of when my subscription is about to expire so I can renew it (this is the plan).

However I don't know how long a subscription takes to expire so I can't work out when to request the reminder.


My filters look like this


    eventFilters = [
        '/restapi/v1.0/subscription/~?threshold=86400&interval=3600',
        '/restapi/v1.0/account/~/telephony/sessions'
    ]

The idea is to receive a reminder every hour when my subcription is due to expire in 24 hours.


I have not received an event yet and I was wondering if this works on the sandbox or if I need to use different threshold and interval parameters.


Ed

developer sandbox
1 |3000

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

Phong Vu avatar image
Phong Vu answered

Did you set the "expiresIn" value when you created your subscription? If you did not, the default value is 7 days (604800 sec). I have never used the expiration notification to renew a subscription but I think it should work. Try to set the "expiresIs" value to 2 days and test your code again with the threshold=86400 (1 day)

1 |3000

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

Edmund Adjei avatar image
Edmund Adjei answered Edmund Adjei commented

Thanks. I checked with our support guy and he says the expiration is actually 20 years so there is no need to subscribe to that event. What I ended up doing is checking the subscription once a month and renewing it if I find it has expired. Not great, but better than nothing. I would have preferred to be notified so that I can then automatically trigger a renewal

2 comments
1 |3000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

The expiration notification should work. In your sample code, you set the threshold for 1 day but I don't see how you set your webhook expiration and if not set, the default value is 7 days. Did you run the app for at least 6 days to test the notification?

I will test it myself when I have time too.

1 Like 1 ·
Edmund Adjei avatar image Edmund Adjei Phong Vu ♦♦ commented ·

No, going RingCentral's recommendation, I didn't subscribe to the renewal alerts in the end

0 Likes 0 ·

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