是否提供了端到端示例来查询成员列表及其基本配置文件,包括团队用户ID和Azure Active Directory (Azure AD)?
我是跟踪https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json和微软的图形邮递员的集合,但它似乎太复杂,我无法理解。
我需要把所有的userId都拿来给我的MS团队
发布于 2020-03-06 08:19:42
您所跟踪的文档确实用于获取所需的信息,包括团队用户AD和Active (Azure )。
我不知道你在哪里不太明白。但强烈建议首先了解Bot框架Rest引用。
您应该注意如何获得基URI (serviceUrl
)。之后,您可以在/conversations/{teamId}/members/
上发出一个GET请求,使用端点serviceUrl
的值。
如下所示:
GET https://{serviceUrl}/v3/conversations/{teamId}/members/
Authorization: Bearer {access token}
Content-Type: application/json
有关如何为bot获取访问令牌的详细信息,请参阅验证从bot到Bot连接器服务的请求。
现在有了请求端点和标头。您可以在Postman中测试Rest。
发布于 2020-03-06 09:24:35
获得团队用户详细信息的最佳方法是通过获取名册详细信息。
您还可以使用Graph获取团队成员/小组成员。但是这个API提供了用户的基本细节。喜欢
[
{
"@odata.type": "#microsoft.graph.user",
"id": "xxxxxxx-95ea-xxxxxxxxx",
"businessPhones": [
"xxxxxxxxxxxxx"
],
"displayName": "Vivek",
"givenName": "Vivek",
"jobTitle": "xxxxxxxx",
"mail": "xxxxxxxx@microsoft.com",
"mobilePhone": "xxxxxxxxxxx",
"officeLocation": "LINCOLN xxxxxxxxx",
"preferredLanguage": null,
"surname": "Shah",
"userPrincipalName": "xxxxxxxx@microsoft.com"
},
]
发布于 2020-03-06 10:26:51
下面是我用来获取团队用户ID的命令
https://stackoverflow.com/questions/60550732
复制相似问题