Can I subscript to other extension's SMS event?

  • 1
  • Question
  • Updated 3 weeks ago
I have an urgent question about subscript to SMS message-store event. If I am an administrator, can I subscript to other extension's SMS event so that I receive the SMS that belongs to their number?


I found the following two links about the present event, but I am just not sure about the SMS event and if it will work for the direct number of other extensions. 
https://devcommunity.ringcentral.com/ringcentraldev/topics/read-sms-message-on-another-account
https://devcommunity.ringcentral.com/ringcentraldev/topics/fyfygcftg


Can you please confirm?
Photo of Arnold Mo

Arnold Mo

  • 70 Points
  • sad

Posted 7 months ago

  • 1
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,894 Points 2k badge 2x thumb
Arnold,

in our current version of the product administrators don't have the access to users' messages including SMS. It means that it is impossible to get information about another user messages neither through regular REST call nor via subscription.

There is an enhancement request to implement permission-based access to other user messages but unfortunately I can't provide any estimates now when it will be approved and released.
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
Is there any movement on this enhancement request? I currently have a need to archive all SMS in a CRM. It looks like in order to do this I need to iterate over each extension authorizing each request with the user's password. That would mean I need to store the passwords and hope I get notified if someone changes theirs :(
(Edited)
Photo of Phong Vu

Phong Vu, Devangelist

  • 2,696 Points 2k badge 2x thumb
Unfortunately, there is no message-store access for company level. This means that even an admin extension cannot access the message-store of other standard extensions. I think this is because of some privacy protection restriction but not 100% sure about it.
(Edited)
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,894 Points 2k badge 2x thumb
I think if you authorize under SuperAdmin user it will be possible to access other users' messages.

To subscribe you can specify multiple filters (for each extension) in subscription like:

   "eventFilters":    [
      "/restapi/v1.0/account/255537016/extension/256440016/message-store/instant?type=SMS",
      "/restapi/v1.0/account/255537016/extension/255537016/message-store/instant?type=SMS"
   ],

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

For polling you should be able to explicitly access other users' mailboxes by specifying corresponding extensionId in Message Store API call, see https://developer.ringcentral.com/api-docs/latest/index.html#!#RefMessageList.html
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
If I am not mistaken I believe you would still need the password for each extension to get at their messages. 
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,894 Points 2k badge 2x thumb
You are mistaken. You can authorize under Admin user and access messages of other extensions by providing those extensions' IDs in URI. No need to know the password of every extension.
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
Great! I'll give it a whirl. I was suspect as most everyone posting about this says it's not possible.
(Edited)
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
Do you happen to know how I can get a list of all extensions using the C# api?
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
Found it: var extensions = await _restClient.Restapi().Account("~").Extension().List();

I was using the Get() method which only returns a singe entity as opposed to List() which returns them all. Makes sense but a little awkward in how the methods are named. 
 
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
I was able to access all user's SMS messages successfully. Thanks for the help!
Photo of Will Jensen

Will Jensen

  • 152 Points 100 badge 2x thumb
Here is a snippet for anyone else needing to do this with the C# library:

 var extensions = await _restClient.Restapi().Account("~").Extension().List();

                foreach (var extension in extensions.records)

                {

                    var userExtension = _restClient.Restapi().Account().Extension(extension.id.ToString());

                    var messages = await userExtension.MessageStore().List(new {direction = "Inbound"});
//Do something with the user's messages

}