Hi,
I am implementing a feature which tracks all sent faxes on a NodeJS backend. I don't want to request the API regularly, but subscribe a notification to received events and take actions based on the events.
I checked the documents, the fax sending event tracks inbound faxes, from my understanding, this is for tracking all received faxes, and my final finding is to subscribe Message Events with the following eventFilter
/restapi/v1.0/account/{accountId}/extension/{extensionId}/message-store?type=Fax&direction=Outbound
I added a subscription with this eventFilter, sent several faxes to test this webhook, and found the following two types of events
- events with newCount > 0 which means new faxes have been created. in this case, a field called newMessageIds will be attached and I can easily find out the newly created fax with messageStatus and readStatus
- events with updatedCount > 0, which means, usually, the status of some faxes have been updated, i.e. a fax has been sent successsfully. But in this case, there is no information indicated which faxes have been updated, here is a sample req.body I received for this type of events:
{
uuid: "********************",
event: "/restapi/v1.0/account/**********/extension/*******/message-store",
timestamp: "2023-07-19T15:40:12.734Z",
subscriptionId: "********-****-****-****-************",
ownerId: "********",
body: {
accountId: ********,
extensionId: ********,
lastUpdated: "2023-07-19T15:40:00.232Z",
changes: b
{
type: "Fax",
newCount: 0,
updatedCount: 1,
newMessageIds: e]
}
]
}
}
My question is: is there a way to figure out precisely which faxes have been updated in this case? or the eventFilter is wrong to do such a job? if yes, which one to use? Thanks