如何获得创建的团队Uri?

时间:2018-03-09 12:58:57

标签: c# microsoft-graph

所以我正在创建Microsoft.Graph Group和Team。它们似乎是成功创建的。问题是我无法创建团队Uri。

具有新组ID的我的休息请求如下所示:

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());

1 个答案:

答案 0 :(得分:1)

MS Teams以下列格式生成链接(Get Link to team菜单操作):

https://teams.microsoft.com/l/team/19%3a{channel-id}%40thread.skype/conversations?groupId={group-id}&tenantId={tenant-id}

创建团队后,可以通过端点检索channel-id

GET: https://graph.microsoft.com/beta/groups/{group-id}/channels 

要确定tenant-id,您可以参考Find your Office 365 tenant 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);
}