microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

DeltaWithTokenRequestBuilder: Creates invalid api request

Open
#2,734 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dependency:metadata type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

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 ```
</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DeltaWithTokenRequestBuilder and compare its generated request with the working Delta.ToGetRequestInformation workaround in the issue. Reproduce the two Graph API URLs and verify that the token is sent as a query parameter rather than inside delta(...); done means the fluent builder produces a working request.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.