What is the correct way to get the site delta query to include the correct graph id for each site returned.

Baz Van Den Dungen 0 Reputation points
2024-06-20T01:32:25.0466667+00:00

I am using the C# Graph SDK to retrieve the delta of sites in my organisation and i have noticed that they return results with an ID that cannot be used to retrieve more information about the sharepoint site regardless of if it was deleted or not.

Here is an example of one such ID:image This is the response from the following C# code which generates a request to /sites/delta?$select=displayName,id

var sharePointSites = Graph.Sites
  .Delta
  .GetAsDeltaGetResponseAsync((requestConfiguration) =>
  {
    requestConfiguration.QueryParameters.Select = ["displayName", "id"];
  }).Result;

This ID seems to correspond with the Site Id that is returned when requesting sharepointIds for the same site.

I raised this issue with the graph SDK github here https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2543 however this seems to be more of a graph api issue as the documentation here https://video2.skills-academy.com/en-us/graph/api/site-delta?view=graph-rest-1.0&tabs=http#response-1 seems to be confused as to which id should be expected.

Response 1 shows the useable sharepoint id that can be used to lookup sites in graph API, and Response 2 shows the relatively useless guid with no explanation why there is a difference.

Currently I can work around this by requesting the sharepointIds and siteCollection and reconstructing the Id from the values stored there.

That being said, this feels like its not working as expected and I should be seeing the useable Ids returned in the response.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,193 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,107 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,550 questions
0 comments No comments
{count} votes