Skip to main content

I'm setting up an event handler to handle new message creation events for all extensions. I'm finding the documentation to not be as specific as I like:


https://developer.ringcentral.com/api-docs/latest/index.html#!#RefCreateSubscription


Specifically, I'm not sure if I can create a single subscription for message events from ALL extensions (WITHOUT using a super admin account). The message store api only allows for message extraction for individual extensions one at a time (without a super admin account). So I can only assume the message events work the same way. And if that is the case, that means that I have to create a separate subscription for each and every extension, correct?


Or, alternatively, can I subscribe to message events using a filter like this:


/restapi/v1.0/account/~/extension/~/message-store


without a super admin account?


My concern is this: If I have to create a separate subscription for each and every extension, what happens when the company adds new extensions? I don't see an event I can subscribe to for when new extensions are added. Which means I'm back to polling for new extensions. Hopefully I can avoid that. That's the point of the sub model.


And it would be just a whole lot easier if I can just create a single subscription for messages for the whole company.

Matt, unfortunately we do not support event filter which gives you message events for the whole company. You can include multiple filters which specify particular extension IDs. You can also subscribe to account change events to react on adding/deleting extensions and alter your subscription -- the filter is "/restapi/v1.0/account/{accountId}/extension". It is not a part of public API which is described in documentation today, but you may give it a try. Here is the example of event:

{     "timestamp": "2014-04-29T14:29:27.408+0000",     "subscriptionId": "a45645-0001-cc71-9de3-674476722",     "uuid": "b11c9430-9687-4498-b12b-3fcb470bfe04",     "event": "/restapi/v1.0/account/~/extension",       "body": { "extensions":[             {                "extensionId":"74953947939",              "eventType":"Delete"           },           {                "extensionId":"8798797945",              "eventType":"Create"           },           {                "extensionId":"8475874957",              "eventType":"Update"           }        ]     }  
}
Hope it helps.


Thanks Anton. I'm a little hesitant about using an undocumented feature. Is there a reason it's undocumented? Do you not plan on making it available forever? Or will it get replaced with something else? Also, does this endpoint for extension changes require any special permissions, such as super admin privs? - Thanks
Matt, it is available and documented but now marked as "private" to limit the number of consumers. So it is just a matter of your scope of visibility. I am not sure about privileges. Since it is just reading I think any extension can subscribe to such events because any extension can read company directory (unless this permission is taken out by some custom role definition).  

Reply