Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom query parameters in the latest version of Graph API (5.3.0) #1790

Closed
shirkhanyanhripsime opened this issue Mar 30, 2023 · 3 comments

Comments

@shirkhanyanhripsime
Copy link

I am using Graph SDK. After upgrading Graph Api to the latest version (5.3.0), I can no longer use QueryOptions to include more specific behavior during a request that is not supported by the library (e.g., add payment model /Model A/ to the request).
What can I use instead?
image

@ghost ghost added the Needs: Triage label Mar 30, 2023
@vadrsa
Copy link

vadrsa commented Apr 4, 2023

@andrueastman Can you help with this?

@andrueastman
Copy link
Member

Thanks for raising this @shirkhanyanhripsime

This looks to be an issue with the metadata that needs to be fixed. In the meantime, the call can be made with the SDK as follows.

            var requestInformation = graphClient.Teams["{team-id}"].Channels.GetAllMessages.ToGetRequestInformation();
            requestInformation.UrlTemplate = requestInformation.UrlTemplate.Insert(requestInformation.UrlTemplate.Length-1,",model");
            requestInformation.QueryParameters.Add("model", "A"); //set the model parameter
            var result = await graphClient.RequestAdapter.SendAsync<GetAllMessagesResponse>(requestInformation, GetAllMessagesResponse.CreateFromDiscriminatorValue);

@andrueastman
Copy link
Member

Closing this as this was resolved via microsoftgraph/msgraph-metadata#370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants