You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Given a group ID, I wish to retrieve the DisplayName (only) for the group. Using the online Microsoft Graph Explorer, I can do this successfully.
I want to do it from an application in C#. The problem is that there seems to be no way of specifying the $select parameter (highlighted), since the call graphServiceClient.DirectoryObjects.GetByIds uses POST, and no arguments to PostAsync allow the specification of query parameters.
Is this even possible? It seems like it should work since the call succeeds from the Microsoft Graph Explorer.
works in that it gets ALL the properties including DisplayName. I want to get just DisplayName.
To Reproduce
Steps to reproduce the behavior:
Go to Microsoft Graph Explorer online
Log in using some credentials to an AAD
Get a list of groups
Note down one of the group IDs
See the attached image to enter a request, with query parameters
Execute and see that it works, you get the DisplayName.
Next, use the C# code it suggests.
The suggested code does not even compile:
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Groups.GetByIds.GetByIdsPostRequestBody
{
Ids = new List<string>
{
"00a92ef6-xxx-xxxx-xxxxxxxxe1",
},
Types = new List<string>
{
"group",
},
};
var result = await graphClient.Groups.GetByIds.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "displayName" };
});
Expected behavior
Some means to be provided such that the PostAsync API takes in query parameters.
Screenshots
Client version
Microsoft.Graph 5.12.0
Desktop (please complete the following information):
Browser: Chrome
Additional context
A workaround was made available by a kind soul here: https://stackoverflow.com/a/77451153/4522810
It works with a minor correction to the escaped version of $select.
The text was updated successfully, but these errors were encountered:
Describe the bug
Given a group ID, I wish to retrieve the DisplayName (only) for the group. Using the online Microsoft Graph Explorer, I can do this successfully.
I want to do it from an application in C#. The problem is that there seems to be no way of specifying the
$select
parameter (highlighted), since the callgraphServiceClient.DirectoryObjects.GetByIds
uses POST, and no arguments toPostAsync
allow the specification of query parameters.Is this even possible? It seems like it should work since the call succeeds from the Microsoft Graph Explorer.
What I have tried:
works in that it gets ALL the properties including
DisplayName
. I want to get justDisplayName
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Some means to be provided such that the PostAsync API takes in query parameters.
Screenshots
Client version
Microsoft.Graph 5.12.0
Desktop (please complete the following information):
Additional context
A workaround was made available by a kind soul here: https://stackoverflow.com/a/77451153/4522810
It works with a minor correction to the escaped version of
$select
.The text was updated successfully, but these errors were encountered: