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