question

matt-spinks2179 avatar image
matt-spinks2179 asked Phong Vu answered

Get MessageId from WebHook

We are in the process of integrating web hook functionality so our app will have NRT (near-real-time) displaying of data. We have the mechanism set up, and are receiving event notifications. However, when we receive a notification for a new voicemail message, I receive the following:

{   "uuid": "788125201093500980",   "event": "/restapi/v1.0/account/134636004/extension/134636004/message-store",   "timestamp": "2018-01-18T16:53:59.486Z",   "subscriptionId": "0e677729-95ec-4ad6-9bd3-a00213ab2981",   "ownerId": "134636004",   "body": {    "extensionId": 134636004,    "lastUpdated": "2018-01-18T16:53:47.713+0000",    "changes": [{     "type": "VoiceMail",     "newCount": 1,     "updatedCount": 0    }]   }  }


It's just a notification that there is/are new message(s) in the store. As far as I can tell, there is no indicator for the actual new MessageId in the store. With only this information, I have to query the message store for the latest messages, and compare them to messages we have already logged in our system in order to get the new one. This seems to defeat the purpose of using WebHooks. I could just as easily use a frequent polling method to get the latest messages from the message store without WebHooks, and get similar NRT results.


Am I missing something here? I see that call log notifications use something similar, but they have a SessionId, and I can query from the call log store using that SessionId to get my call info.


Is there a separate event filter I can subscribe to in order to get the message id of new messages? Or is there something similar to the session id that I can use with messages, in order to get only the new message?


Or, is this just the way it is?


Thanks

webhooks
1 |3000

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

anton-nikitin avatar image
anton-nikitin answered matt-spinks2179 commented
Matt, unfortunately we don't have instant voicemail notifications (only SMS instant notifications are supported) at the moment but plan to implement them in the future (Q2-2018 is the earliest I assume).
1 comment
1 |3000

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

matt-spinks2179 avatar image matt-spinks2179 commented ·
Ok. Thanks for the info. I wanted to make sure I wasn't missing something.
0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered
Hi Matt,

While there is no dedicated notification event for VoiceMail, can you try a workaround solution below to see if it helps.

Register for both message-store and missed-calls event
var eventFilters = []
eventFilters.push('/restapi/v1.0/account/~/extension/~/message-store')
eventFilters.push('/restapi/v1.0/account/~/extension/~/missed-calls')
You will receive 2 notifications. One for a missed call event and another one for a new message event. You can use the sessionId from the missed call event to fetch the info of the voicemail in this case. Please try and let me know.

Bests,
Phong Vu
1 |3000

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

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