You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graph/patterns/change-tracking.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,10 @@ API designers can enable the change tracking (delta) capability on a resource in
15
15
16
16
This function returns a delta payload. A delta payload consists of a collection of annotated full or partial Microsoft Graph entities plus either a `nextLink` to further pages of original or change data that are immediately available OR a `deltaLink` to get the next set of changes at some later date.
17
17
18
-
Annotations allow the delta payload to indicate resources or links which have been deleted. API callers are expected to differentiate resource adds from updates by interpreting the id property of the change records against the existence of resources in whatever external system is doing the processing.
18
+
The `nextLink` provides a mechanism to do server-driven paging through the change data that is currently available. When there are no further pages of changes immediately available, a `deltaLink` is returned instead.
19
+
The `deltaLink` provides a mechanism for the API consumer to catch up on changes since their last request to the delta function. If no changes have happened since the last request, then the deltaLink MUST return an empty collection.
20
+
21
+
Both `nextLink` and `deltaLink` MUST be considered opaque URLs. The best practice is to make them opaque via encoding.
19
22
20
23
The pattern requires a sequence of requests on the delta function, for additional details see [Change Tracking](https://learn.microsoft.com/en-us/graph/delta-query-overview?tabs=http#use-delta-query-to-track-changes-in-a-resource-collection):
21
24
@@ -24,12 +27,6 @@ The pattern requires a sequence of requests on the delta function, for additiona
24
27
3. After some time, a GET request to see if there are new changes via the `@odata.deltaLink` URL.
25
28
4.[Optionally] GET requests to retrieve more pages of changes via the `@odata.nextLink` URL.
26
29
27
-
The `nextLink` provides a mechanism to do server-driven paging through the change data that is currently available. When there are no further pages of changes immediately available, a `deltaLink` is returned instead.
28
-
29
-
The `deltaLink` provides a mechanism for the API consumer to catch up on changes since their last request to the delta function. If no changes have happened since the last request, then the deltaLink MUST return an empty collection.
30
-
31
-
Both `nextLink` and `deltaLink` MUST be considered opaque URLs. The best practice is to make them opaque via encoding.
32
-
33
30
Delta payload requirements:
34
31
- The payload is a collection of change records using the collection format.
35
32
- The change records are full or partial representations of the resources according to their resource types.
@@ -41,9 +38,12 @@ Delta payload requirements:
41
38
- When a link to an entity is deleted, when the linked entity is deleted, or when a link to an entity is added, the implementer MUST return a `property@delta` annotation.
42
39
- When a link to an entity is deleted, but the entity still exists, the reason MUST be set to `changed`.
43
40
- When a link to an entity is deleted along with the entity, the reason MUST be set to `deleted`.
44
-
41
+
45
42
API producers MAY choose to collate multiple changes to the same resource into a single change record.
46
43
44
+
API callers are expected to differentiate resource adds from updates by interpreting the id property of the change records against the existence of resources in whatever external system is doing the processing.
45
+
46
+
47
47
## When to use this pattern
48
48
49
49
API consumers want a pull mechanism to request and process change to Microsoft Graph data, either via proactive polling or by responding to Microsoft Graph notifications.
@@ -65,7 +65,7 @@ API consumers need guaranteed data integrity over the set of changes to Microsof
65
65
`/users/delta` that returns the changes to the users' collection
66
66
or to some logical parent resource, where the change records are implied to be relative to all collections contained within the parent, for example
67
67
`/me/planner/all/delta` – this returns changes to any resource within planner that a user is subscribed to as a heterogenous collection.
68
-
- API producers might use `$skipToken` and `$deltaToken` within their implementations of `nextLink` and `deltaLink`, however the URLs are defined as being opaque and the existence of the tokens MUST NOT be documented. It is not a breaking change to modify the structure of `nextLinks` or `deltaLinks`.-
68
+
- API producers should use `$skipToken` and `$deltaToken` within their implementations of `nextLink` and `deltaLink`, however the URLs are defined as being opaque and the existence of the tokens MUST NOT be documented. It is not a breaking change to modify the structure of `nextLinks` or `deltaLinks`.-
69
69
-`nextLink` and `deltaLink` URLs are valid for a specific period before the client application needs to run a full synchronization again.For `nextLink`, a minimal validity time should be 1 hour. For `deltaLink`, a minimal validity time should be seven days. When a link is no longer valid it must return a standard error with a 410 GONE response code.
70
70
- Although this capability is similar to the OData `$delta` feed capability, it is a different construct. Microsoft Graph APIs MUST provide change tracking through the delta function and MUST NOT implement the OData `$delta` feed when providing change tracking capabilities to ensure the uniformity of the API experience.
71
71
- The Graph delta payload format has some deviations from the OData 4.01 change tracking format to simplify parsing, for example the context annotation is removed.
@@ -81,11 +81,11 @@ API consumers need guaranteed data integrity over the set of changes to Microsof
0 commit comments