Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何获取创建的团队Uri?_C#_Microsoft Graph Api - Fatal编程技术网

C# 如何获取创建的团队Uri?

C# 如何获取创建的团队Uri?,c#,microsoft-graph-api,C#,Microsoft Graph Api,因此,我正在创建Microsoft.Graph组和团队。而且似乎它们是成功创建的。问题是我无法创建团队Uri 具有新组id的Rest请求如下所示: RestClient client = new RestClient("https://graph.microsoft.com/beta/groups/" + groupId + "/endpoints"); RestRequest request = new RestRequest(Method.GET); request.AddHeader("A

因此,我正在创建Microsoft.Graph组和团队。而且似乎它们是成功创建的。问题是我无法创建团队Uri

具有新组id的Rest请求如下所示:

RestClient client = new RestClient("https://graph.microsoft.com/beta/groups/" + groupId + "/endpoints");
RestRequest request = new RestRequest(Method.GET);
request.AddHeader("Authorization", accessToken);
IRestResponse response = await client.ExecuteTaskAsync(request, new CancellationToken());

MS团队以以下格式生成链接(
Get link to team
menu action):

https://teams.microsoft.com/l/team/19%3a{channel-id}%40thread.skype/conversations?groupId={group-id}&tenantId={tenant-id}
创建团队后,可以通过端点检索通道id:

GET: https://graph.microsoft.com/beta/groups/{group-id}/channels 
要确定
租户id
,您可以参考 文章

示例

static string GetTeamLink(string groupId, string channelId,string tenantId = null)
{
    return
            String.Format("https://teams.microsoft.com/l/team/19%3a{0}%40thread.skype/conversations?groupId={1}&tenantId={2}",
                channelId.Replace("-", string.Empty),
                groupId,
                tenantId);
}