Skip to content

Commit 76e1da0

Browse files
committed
corrected examples
1 parent 5558b8d commit 76e1da0

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

graph/patterns/change-tracking.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ API consumers require an efficient way to acquire changes to data in the Microso
1111

1212
## Solution
1313

14-
API designers can enable the change tracking (delta) capability on a resource in the Microsoft Graph (typically on an entity collection or a parent resource) by declaring a delta function on that resource.
14+
API designers can enable the change tracking (delta) capability on a resource in the Microsoft Graph (typically on an entity collection or a parent resource) by declaring a delta function on that resource and applying `Org.OData.Capabilities.V1.ChangeTracking` annotation.
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 poll to get the next set of changes as they occur.
1717

@@ -39,8 +39,8 @@ Delta payload requirements
3939
- When an entity is deleted. the reason MUST be set to “deleted” if the entity cannot be restored.
4040
- There is no mechanism to indicate that a resource has entered or exited the dataset based on a change that causes it to match or no longer match any `$filter` query parameter.
4141
- 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-
- When a link to an entity is deleted, but the entity still exists, the reason MUST be set to `changed`.
43-
- When a link to an entity is deleted along with the entity, the reason MUST be set to `deleted`.
42+
- When a link to an entity is deleted, but the entity still exists, the reason MUST be set to `changed`.
43+
- When a link to an entity is deleted along with the entity, the reason MUST be set to `deleted`.
4444

4545
API producers MAY choose to collate multiple changes to the same resource into a single change record.
4646

@@ -84,10 +84,10 @@ API consumers need guaranteed data integrity over the set of changes to Microsof
8484
### Change tracking on entity set
8585

8686
```
87-
<Function Name="delta" IsBound="true">
88-
<Parameter Name="bindingParameter" Type="Collection(Microsoft.DirectoryServices.user)" />
89-
<ReturnType Type="Collection(Microsoft.DirectoryServices.user)" />
90-
</Function>
87+
<Function Name="delta" IsBound="true" ags:OwnerService="Microsoft.DirectoryServices">
88+
<Parameter Name="bindingParameter" Type="Collection(graph.user)" />
89+
<ReturnType Type="Collection(graph.user)" />
90+
</Function>
9191
<EntitySet Name="users" EntityType="Microsoft.DirectoryServices.user">
9292
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
9393
<Record>
@@ -100,27 +100,32 @@ API consumers need guaranteed data integrity over the set of changes to Microsof
100100
### Change tracking on navigation property
101101

102102
```
103-
<Function Name="delta" IsBound="true">
104-
<Parameter Name="bindingParameter" Type="Collection(microsoft.education.rostering.api.educationClass)" />
105-
<ReturnType Type="Collection(microsoft.education.rostering.api.educationClass)" />
106-
</Function>
107-
<EntityType Name="educationRoot">
108-
<NavigationProperty Name="classes" Type="Collection(microsoft.education.rostering.api.educationClass)" ContainsTarget="true">
109-
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking">
110-
<Record>
111-
<PropertyValue Property="Supported" Bool="true" />
112-
</Record>
113-
</Annotation>
114-
</NavigationProperty>
103+
<EntityType Name="educationRoot" ags:OwnerService="Microsoft.EducationRosteringAPIs" ags:WorkloadIds="Microsoft.EducationAssignment,Microsoft.EducationDataSync">
104+
<NavigationProperty Name="classes" Type="Collection(graph.educationClass)" ContainsTarget="true" />
105+
<NavigationProperty Name="me" Type="graph.educationUser" ContainsTarget="true" />
106+
<NavigationProperty Name="schools" Type="Collection(graph.educationSchool)" ContainsTarget="true" />
107+
<NavigationProperty Name="synchronizationProfiles" Type="Collection(graph.educationSynchronizationProfile)" ContainsTarget="true" ags:OwnerService="Microsoft.EducationDataSync" />
108+
<NavigationProperty Name="users" Type="Collection(graph.educationUser)" ContainsTarget="true" />
115109
</EntityType>
110+
<Function Name="delta" IsBound="true" ags:OwnerService="Microsoft.EducationRosteringAPIs">
111+
<Parameter Name="bindingParameter" Type="Collection(graph.educationClass)" />
112+
<ReturnType Type="Collection(graph.educationClass)" />
113+
</Function>
114+
<Annotations Target="microsoft.graph.educationRoot/classes">
115+
<Annotation Term="Org.OData.Capabilities.V1.ChangeTracking" ags:OwnerService="Microsoft.EducationRosteringAPIs">
116+
<Record>
117+
<PropertyValue Property="Supported" Bool="true" />
118+
</Record>
119+
</Annotation>
120+
</Annotations>
116121
```
117122

118123
### Delta payload
119124

120-
Here, a user resource is updated, and there is one user added to and one removed from that user’s directReports collection. Additionally, a second user is deleted. In this case, there are no further pages of change records currently available.
125+
Here, a user resource is updated, and there is one user added to and one removed from that user’s directReports collection. Additionally, a second user is deleted. In this case, there are no further pages of change records currently available. For detailed sequence of requests see [public documentation](https://learn.microsoft.com/en-us/graph/delta-query-users?tabs=http).
121126

122127
```
123-
GET https://graph.microsoft.com/v1.0/users/delta
128+
GET https://graph.microsoft.com/v1.0/users/delta?$skiptoken=pqwSUjGYvb3jQpbwVAwEL7yuI3dU1LecfkkfLPtnIjvB7XnF_yllFsCrZJ
124129
125130
{
126131
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",

0 commit comments

Comments
 (0)