0

When calling a delta query using C# SDK on Graph API, different formatted deltaLinks are returned, depending on if it's the initial request or subsequent requests. On initial request this is returned:

https://graph.microsoft.com/v1.0/groups/{groupId}/drive/root/microsoft.graph.delta?token={token}

On subsequent requests this is returned:

https://graph.microsoft.com/v1.0/groups('{groupId}')/drive/root/microsoft.graph.delta(token='{token}')

This makes it a bit annoying to get the token from the url, for storing. Could this be fixed?

BoKDamgaard
  • 378
  • 1
  • 19
  • I agree, that is annoying. Both forms are valid OData URIs. We should have stuck to segment as key IMHO. I doubt that this will change as folks have taken a dependency on this behvior. – Michael Mainer Feb 25 '19 at 18:54
  • Can you show the code you are using to get the second URL? I'm running our sample delta query on mailfolders and not seeing the same behavior. – Darrel Miller Feb 25 '19 at 18:55
  • 1
    Also, it is probably wise to store the entire DeltaLink rather than just token anyway. The token will only work against that resource collection anyway. That way, you don't have to do any parsing. – Darrel Miller Feb 25 '19 at 18:56
  • [Darrel](https://stackoverflow.com/users/6819/darrel-miller) The deltaLink is extracted the same way on both scenarios. I think it's due to the fact that the SDK formats the url differently when starting the delta request. With no token present to the SDK, the url looks like the first one, both on second request, where the token is present, the request url changes to the second one. Maybe it's a SDK thing. – BoKDamgaard Feb 26 '19 at 08:29
  • [Darrel](https://stackoverflow.com/users/6819/darrel-miller) Btw, I need to extract the token, to use the C# SDK. It takes a token :) – BoKDamgaard Feb 26 '19 at 08:30
  • Here's a sample that we are just in the process of updating that uses the SDK to do delta queries https://github.com/microsoftgraph/consoleApp-deltaQuery-dotNet-sample/blob/25b5039bb44b61e36e4dee22b544889b5967463f/ConsoleApplication/Program.cs#L128 The SDK doesn't touch the format of the DelaLink URL and you don't need to extract the token. You can just use InitializeNextPageRequest with the DeltaQueryLink. – Darrel Miller Feb 26 '19 at 16:00

0 Answers0