We're using Microsoft change notifications to listen to new emails in a user's mailbox. Right now, for each new email, a separate trigger is sent to our endpoint. We tested by sending 10s of emails within the same second and Microsoft sends a separate hit for each email like this:
{
"value": [
{
"id": "lsgTZMr9KwAAA",
"subscriptionId":"{subscription_guid}",
"subscriptionExpirationDateTime":"2016-03-19T22:11:09.952Z",
"clientState":"secretClientValue",
"changeType":"created",
"resource":"users/{user_guid}@{tenant_guid}/messages/{long_id_string}",
"tenantId": "84bd8158-6d4d-4958-8b9f-9d6445542f95",
"resourceData":
{
"@odata.type":"#Microsoft.Graph.Message",
"@odata.id":"Users/{user_guid}@{tenant_guid}/Messages/{long_id_string}",
"@odata.etag":"W/\"CQAAABYAAADkrWGo7bouTKlsgTZMr9KwAAAUWRHf\"",
"id":"{long_id_string}"
}
}
]
}
We were expecting that for changes that occur very rapidly, notifications will be grouped together and sent in a single API trigger because if you look, the value key in the above response is an array.
Is it currently possible to somehow specify to Microsoft Notifications to send notifications grouped together instead of a separate API call? The problem is we don't want Microsoft to hit our API endpoint too often to avoid choking of our servers as we'll be subscribing to hundreds of thousands of mailboxes.
Any help in this regard shall be appreciated.