"找不到'团队'细分市场的资源



我正在尝试通过Microsoft graph-API访问Teams-Ressourcec。我好像碰上了墙。该应用程序具有所需的权限(如MS文档中所列(

我尝试过的查询:一个简单的获取:

string querystring = "api-version=1.6";
var uri = "https://graph.windows.net/contoso.onmicrosoft.com/teams/" + TeamID+ "/channels?" + querystring;
Console.WriteLine(uri);
HTTPClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", result);
var GetResult = await HTTPClient.GetAsync(uri);

这个在Graph Explorer(v1.0(中使用委托权限,但它使用委托用户权限,而不是应用程序权限。

迁移团队创建POST:

string querystring = "api-version=1.6";
var uri = "https://graph.windows.net/contoso.onmicrosoft.com/teams?" + querystring;
HTTPClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
HttpRequestMessage Content = new HttpRequestMessage();
Content.Content = new StringContent("{   "@microsoft.graph.teamCreationMode": "migration",   "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",   "displayName": "My Sample Migration Team",   "description": "",   "createdDateTime": "2020-03-14T11:22:17.043Z" }", Encoding.UTF8, "application/json");
var GetResult = await HTTPClient.PostAsync(uri, Content.Content);

对于这两者,我都收到了";找不到分段"teams"的资源。有人看到了吗?如何通过Graph API访问团队资源?

当您调用时https://graph.windows.net,这是Azure AD Graph,已弃用,将于2022年6月30日退役。

我建议您切换到使用Microsoft Graph,您称之为https://graph.microsoft.com/version。请参阅图形资源管理器以开始操作。

选中"列出频道"了解如何使用MS Graph列出团队频道。

最新更新