question

Greenboard Dev Team avatar image
Greenboard Dev Team asked ·

unable to subscribe with all extensions defined as "~"

When we send POST request to /subscription endpoint

with this payload:

{'eventFilters': ['/restapi/v1.0/account/~/extension/~/missed-calls',
  '/restapi/v1.0/account/~/extension/~/start-ring',
  '/restapi/v1.0/account/~/extension/~/stop-ring',
  '/restapi/v1.0/account/~/extension/~/incoming-call-pickup',
  '/restapi/v1.0/account/~/extension/~/voicemail',
  '/restapi/v1.0/account/~/extension/~/message-store'],
 'deliveryMode': {'transportType': 'WebHook',
  'address': 'https://1e............315',
  'verificationToken': '75...........2e986'},
 'expiresIn': 630720000}

the address is successfully registered

but it is then visible then like:


        {
            "uri": "https://platform.ringcentral.com/restapi/v1.0/subscription/626ea38.............0c561f",
            "id": "626ea384-4576-433b-b9b2-44af300c561f",
            "creationTime": "2020-08-04T14:53:59.642Z",
            "status": "Active",
            "eventFilters": [
                "/restapi/v1.0/account/2460114020/extension/2744114015/incoming-call-pickup",
                "/restapi/v1.0/account/2460114020/extension/2744114015/voicemail",
                "/restapi/v1.0/account/2460114020/extension/2744114015/message-store",
                "/restapi/v1.0/account/2460114020/extension/2744114015/start-ring",
                "/restapi/v1.0/account/2460114020/extension/2744114015/stop-ring",
                "/restapi/v1.0/account/2460114020/extension/2744114015/missed-calls"
            ],
            "expirationTime": "2036-06-08T15:47:19.642Z",
            "expiresIn": 499998021,
            "deliveryMode": {
                "transportType": "WebHook",
                "encryption": false,
                "address": "https://1............315"
            }
        }


why '~' was replaced with 2460...020 and 2744...015?


I wanted to register for a subscription of events about all phone numbers/extensions.

webhook subscriptionnotification subscription
1 |1000 characters needed characters left characters exceeded

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 ·

The tilde "~" will be converted to an id based on the access token information. So in the backend, it will be replaced with the account id and extension id of the user/extension, who logs in the app. And in your case, the user you logged in.

If you want to register for other extensions (or all extensions), first check the API reference to see if it there is a filter for the account level (for example the presence notification supports an account level "/restapi/v1.0/account/{accountId}/presence"). For some filters such as the telephony session event, you can register for other extensions by specifying multiple filter with the exact extension id in each filter. In that case, you can read the account's extension list and capture the extension ids and specify them in your filters.

I have some explanation about registering multiple extensions notification in this blog. So check it out.

Share
1 |1000 characters needed characters left characters exceeded

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

Greenboard Dev Team avatar image
Greenboard Dev Team answered ·

@Phong Vu thank you

however, following you and registering filters for all extensions

I have to use extension level because account level is invalid for my filters

Also, I see:
ApiException: Not allowed subscribe for missed calls of another extension

and the same for incoming-calls


so how can I register all extensions for one single API application?

am I supposed to repeat registration from every account being logged into API.

this is not available to me, it must be one account with granted permissions.


1 comment Share
1 |1000 characters needed characters left characters exceeded

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

I have not tried the missed call notification for other extensions. But did you login with an admin user? If an admin user does not help, then it simply not supported and I think that you have to implement a different way to detect missed calls using the telephony session event notification.

Can you quickly confirm and let me know so I can show you how to detect missed calls using different methods.

0 Likes 0 · ·
Greenboard Dev Team avatar image
Greenboard Dev Team answered ·

@Phong VuOn production env I log in with non-admin account.

but I've checked on sandbox with an admin account, and I see the same exception:

ApiException: Not allowed subscribe for missed calls of another extension


1 comment Share
1 |1000 characters needed characters left characters exceeded

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

Then it is obviously not supported. You read the blog I mentioned earlier and checkout this part to see how to detect a missed call using the telephony session event notification. This does not require an admin user so any user extension can detect missed call of other extensions under the same account.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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