Участник группы Delta Delta ExpandC#

Место общения программистов C#
Anonymous
Участник группы Delta Delta Expand

Сообщение Anonymous »

Я пытаюсь прочитать участники DisplayName, mail , используя
https://graph.microsoft.com/v1.0/groups ... $filter=id eq '{groupId}'&$expand=members($select=id,displayName,mail)

Но я получаю только идентификатор только. Как получить также имя DisplayName ? Я знаю участники@delta свойство содержит только идентификаторы объектов членов в группе
public async Task MeetingsDetails()
{
var clientSecretCredential = new ClientSecretCredential(TenantId, ClientId,ClientSecret);

string[] scopes = new string[] { "https://graph.microsoft.com/.default" }; // Or specific scopes you need

AccessToken tokenResult = await clientSecretCredential.GetTokenAsync(new TokenRequestContext(scopes));

var accessToken = tokenResult.Token;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

string url = $"https://graph.microsoft.com/v1.0/groups ... $filter=id eq '{groupId}'&$expand=members($select=id,displayName,mail)";

var response = await client.GetAsync(url);

if (response.IsSuccessStatusCode)
{
var json = await response.Content.ReadAsStringAsync();
Console.WriteLine(json);
}
else
{
Console.WriteLine($"Error: {response.StatusCode}, {await response.Content.ReadAsStringAsync()}");
}
}


Подробнее здесь: https://stackoverflow.com/questions/796 ... splay-name

Вернуться в «C#»