| title | calendar: delta |
|---|---|
| description | Get a set of calendars added, deleted, or updated in a user's mailbox. |
| ms.localizationpriority | medium |
| author | vikailas |
| ms.subservice | outlook |
| doc_type | apiPageType |
| ms.date | 06/22/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer] Get a set of calendar resources added, deleted, or updated in one or more calendars.
Typically, synchronizing calendars in a mailbox in a local store entails a round of multiple delta function calls. The initial call is a full synchronization, and every subsequent delta call in the same round gets the incremental changes (additions, deletions, or updates). Using deltas allows you to incrementally maintain and synchronize a local store of calendars in the specified mailbox.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
To begin tracking changes, you make a request including the delta function on the calendara resource.
- To get incremental changes of the calendar list in the user's mailbox:
GET /me/calendars/delta
GET /users/{usersId}/calendars/deltaTracking changes in groups incurs a round of one or more delta function calls. If you use any query parameter (other than $deltatoken and $skiptoken), you must specify it in the initial delta request. Microsoft Graph automatically encodes any specified parameters into the token portion of the @odata.nextLink or @odata.deltaLink URL provided in the response.
You only need to specify any desired query parameters once upfront.
In subsequent requests, copy and apply the @odata.nextLink or @odata.deltaLink URL from the previous response, as that URL already includes the encoded, desired parameters.
| Query parameter | Type | Description |
|---|---|---|
| $deltatoken | string | A state token returned in the @odata.deltaLink URL of the previous delta function call for the same calendar list, 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 calendar list. |
| $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 calendar list. |
This method supports optional OData query parameters to help customize the response.
- You can use a
$selectquery parameter as in any GET request to specify only the properties your need for best performance. - The delta function doesn't support the following query parameters:
$expand,$filter,$orderby,$search, and$select.
| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | string | application/json. Required. |
| Prefer | string | odata.maxpagesize={x}. Optional. |
Don't supply a request body for this method.
If successful, this function returns a 200 OK response code and a calendar collection in the response body.
The following example shows a request. There's no $select parameter, so a default set of properties is tracked and returned.
GET https://graph.microsoft.com/beta/me/calendars/delta
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
If the request is successful, the response includes a state token, which is either a skipToken (in an @odata.nextLink response header) or a deltaToken (in an @odata.deltaLink response header). Respectively, they indicate whether you should continue with the round or you have completed getting all the changes for that round.
The response below shows a deltaToken in an @odata.deltaLink response header.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(calendar)",
"value": [
{
"@odata.type": "#microsoft.graph.calendar",
"id": "AQMkADRhZThkMDVjLTJmNDctNDUyZC05YjA2LTI2YzRmMTIxOWJhZQBGAAADVDIMnvGkNkGo5_ASLe7iUQcAvXegGcyc-0O1dA1ftrtB6QAAAgEGAAAAvXegGcyc-0O1dA1ftrtB6QAAAUSwewAAAA==",
"name": "Calendar",
"color": "auto",
"hexColor": "",
"groupClassId": "0006f0b7-0000-0000-c000-000000000046",
"isDefaultCalendar": true,
"changeKey": "vXegGcyc/0O1dA1ftrtB6QAAAEO+6Q==",
"canShare": true,
"canViewPrivateItems": true,
"isShared": false,
"isSharedWithMe": false,
"canEdit": true,
"calendarGroupId": null,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": true,
"isRemovable": false,
"owner": {
"name": "Samantha Booth",
"address": "samanthab@contoso.com"
}
},
{
"@odata.type": "#microsoft.graph.calendar",
"id": "AQMkADRhZThkMDVjLTJmNDctNDUyZC05YjA2LTI2YzRmMTIxOWJhZQBGAAADVDIMnvGkNkGo5_ASLe7iUQcAvXegGcyc-0O1dA1ftrtB6QAAAgEGAAAAvXegGcyc-0O1dA1ftrtB6QAAAU4pOwAAAA==",
"name": "Birthdays",
"color": "auto",
"hexColor": "",
"groupClassId": "0006f0b7-0000-0000-c000-000000000046",
"isDefaultCalendar": false,
"changeKey": "vXegGcyc/0O1dA1ftrtB6QAAAEzvog==",
"canShare": false,
"canViewPrivateItems": true,
"isShared": false,
"isSharedWithMe": false,
"canEdit": false,
"calendarGroupId": null,
"allowedOnlineMeetingProviders": [],
"defaultOnlineMeetingProvider": "unknown",
"isTallyingResponses": false,
"isRemovable": true,
"owner": {
"name": "Samantha Booth",
"address": "samanthab@contoso.com"
}
}
],
"@odata.deltaLink": "https://graph.microsoft.com/beta/me/calendars/delta?$deltatoken=LztZwWjo5IivWBhyxw5rAIPrk_3pGHcZr4U33FHo0HpyBLqdo9QZIWfEL4AW1jMLBmo-o1ybmYCWlzQ5elO2bEDejh9Z8kYv_z4nhmHoC5Y.7Wdj3MWiils6M--JMM9dMyiLCh-1he4AZCqBu-8i42o"
}