Skip to content

Commit 7d22a09

Browse files
committed
public namespace
1 parent 7822842 commit 7d22a09

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

graph/patterns/change-tracking.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ API designers can enable the change tracking (delta) capability on a resource in
1515

1616
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.
1717

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.
1922

2023
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):
2124

@@ -24,12 +27,6 @@ The pattern requires a sequence of requests on the delta function, for additiona
2427
3. After some time, a GET request to see if there are new changes via the `@odata.deltaLink` URL.
2528
4. [Optionally] GET requests to retrieve more pages of changes via the `@odata.nextLink` URL.
2629

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-
3330
Delta payload requirements:
3431
- The payload is a collection of change records using the collection format.
3532
- The change records are full or partial representations of the resources according to their resource types.
@@ -41,9 +38,12 @@ Delta payload requirements:
4138
- 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.
4239
- When a link to an entity is deleted, but the entity still exists, the reason MUST be set to `changed`.
4340
- When a link to an entity is deleted along with the entity, the reason MUST be set to `deleted`.
44-
41+
4542
API producers MAY choose to collate multiple changes to the same resource into a single change record.
4643

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+
4747
## When to use this pattern
4848

4949
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
6565
`/users/delta` that returns the changes to the users' collection
6666
or to some logical parent resource, where the change records are implied to be relative to all collections contained within the parent, for example
6767
`/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`.-
6969
- `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.
7070
- 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.
7171
- 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
8181
### Change tracking on entity set
8282

8383
```
84-
<Function Name="delta" IsBound="true" ags:OwnerService="Microsoft.DirectoryServices">
84+
<Function Name="delta" IsBound="true">
8585
<Parameter Name="bindingParameter" Type="Collection(graph.user)" />
8686
<ReturnType Type="Collection(graph.user)" />
8787
</Function>
88-
<EntitySet Name="users" EntityType="Microsoft.DirectoryServices.user">
88+
<EntitySet Name="users" EntityType="graph.user">
8989
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
9090
<Record>
9191
<PropertyValue Property="Supported" Bool="true" />
@@ -97,19 +97,19 @@ API consumers need guaranteed data integrity over the set of changes to Microsof
9797
### Change tracking on navigation property
9898

9999
```
100-
<EntityType Name="educationRoot" ags:OwnerService="Microsoft.EducationRosteringAPIs" ags:WorkloadIds="Microsoft.EducationAssignment,Microsoft.EducationDataSync">
100+
<EntityType Name="educationRoot">
101101
<NavigationProperty Name="classes" Type="Collection(graph.educationClass)" ContainsTarget="true" />
102102
<NavigationProperty Name="me" Type="graph.educationUser" ContainsTarget="true" />
103103
<NavigationProperty Name="schools" Type="Collection(graph.educationSchool)" ContainsTarget="true" />
104-
<NavigationProperty Name="synchronizationProfiles" Type="Collection(graph.educationSynchronizationProfile)" ContainsTarget="true" ags:OwnerService="Microsoft.EducationDataSync" />
104+
<NavigationProperty Name="synchronizationProfiles" Type="Collection(graph.educationSynchronizationProfile)" ContainsTarget="true"/>
105105
<NavigationProperty Name="users" Type="Collection(graph.educationUser)" ContainsTarget="true" />
106106
</EntityType>
107-
<Function Name="delta" IsBound="true" ags:OwnerService="Microsoft.EducationRosteringAPIs">
107+
<Function Name="delta" IsBound="true">
108108
<Parameter Name="bindingParameter" Type="Collection(graph.educationClass)" />
109109
<ReturnType Type="Collection(graph.educationClass)" />
110110
</Function>
111111
<Annotations Target="microsoft.graph.educationRoot/classes">
112-
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking" ags:OwnerService="Microsoft.EducationRosteringAPIs">
112+
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
113113
<Record>
114114
<PropertyValue Property="Supported" Bool="true" />
115115
</Record>

0 commit comments

Comments
 (0)