Laravel Microsoft Graph

Delta

Delta Function From Microsoft Documentation:

A delta function call for messages in a folder is similar to a GET request, except that by appropriately applying state tokens in one or more of these calls, you can query for incremental changes in the messages in that folder. This allows you to maintain and synchronize a local store of a user's messages without having to fetch the entire set of messages from the server every time.

Use Cases

You can use the delta method, if you want fast response time, and fetch only the messages (emails) has been recently modified, or created.

You can use the feature as follows

Before:

$emails = MsGraph::emails()->get(...)

Now:

$emails = MsGraph::emails()->delta(?bool $delta = true)->get(...)

Also this can be used with MsGraphAdmin

$emails = MsGraphAdmin::emails()->delta(?bool $delta = true)->get(...)

Query Params:

Query parameter Type Description
$deltatoken string A state token returned in the @odata.deltaLink URL of the previous delta function call for the same message collection, indicating the completion of that round of change tracking. Save and apply the entire @odata.deltaLink URL including this token in the first request of the next round of change tracking for that collection.
$skiptoken string A state token returned in the @odata.nextLink URL of the previous delta function call, indicating there are further changes to be tracked in the same message collection.
changeType string A custom query option to filter the delta response based on the type of change. Supported values are created, updated, or deleted.

Limitation

  • $search Query Param is not supported
  • $filter only works with $filter=receivedDateTime+ge+{value} or $filter=receivedDateTime+gt+{value}
  • $orderby only supports $orderby=receivedDateTime+desc

References

For more info, about the API. Check: https://learn.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0&tabs=php

Copyright © 2006 - 2025 DC Blog - All rights reserved.