Question

unable to subscribe with all extensions defined as "~"

  • 4 August 2020
  • 3 replies
  • 688 views

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.


3 replies

Userlevel 1

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.

@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.


@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


Reply