microsoftgraph / msgraph-sdk-dotnet

Microsoft Graph Client Library for .NET!
https://graph.microsoft.com
Other
703 stars 251 forks source link

DeltaWithTokenRequestBuilder: Creates invalid api request #2734

Open phelm1-landolakes opened 2 weeks ago

phelm1-landolakes commented 2 weeks ago

Describe the bug

This url works:

https://graph.microsoft.com/v1.0/sites/landolakes.sharepoint.com/siteId/lists/listId/items/delta()?token=changeTokenFromPreviousDeltRequest

This url returns a 404 error

https://graph.microsoft.com/v1.0/sites/landolakes.sharepoint.com/siteId/lists/listId/items/delta(token='changeTokenFromPreviousDeltRequest')

Using the DeltaWithTokenRequestBuilder creates the second, incorrect url. And no other fluent way to set the token as a query parameter.

Expected behavior

The request created by the `DeltaWithTokenRequestBuilder' should work with the graph api. And/Or provide a Fluent way to properly set the token parameter.

How to reproduce

See above.

SDK Version

5.61.0

Latest version known to work for scenario above?

No response

Known Workarounds

        var ri = graphServiceClient.Sites[siteId].Lists[ListId].Items.Delta.ToGetRequestInformation();

        if (!string.IsNullOrWhiteSpace(currentDeltaToken))
        {
            ri.QueryParameters.Add("token", currentDeltaToken);
            ri.UrlTemplate = "{+baseurl}/sites/{site%2Did}/lists/{list%2Did}/items/delta()?token={token}{%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}";
        }

        var response = await graphServiceClient.RequestAdapter.SendAsync<Microsoft.Graph.Sites.Item.Lists.Item.Items.Delta.DeltaGetResponse>(ri, Microsoft.Graph.Sites.Item.Lists.Item.Items.Delta.DeltaGetResponse.CreateFromDiscriminatorValue, cancellationToken: cancellationToken);

This is crunchy, but it works.

Debug output

Click to expand log ``` ```

Configuration

No response

Other information

No response

andrueastman commented 1 week ago

Depends on the resolution of https://github.com/microsoftgraph/msgraph-metadata/issues/431