如何使用 Microsoft Graph API 检索其他用户的 MS Teams 聊天记录?

问题描述:

作为全局管理员,我正在尝试检索其他用户的 MS Teams 聊天列表,但是无论我将哪个 ID 传递给 GET/beta/users/{id}/chats响应始终是经过身份验证的用户的聊天列表.如何获取不同用户的聊天列表?

As a global administrator I'm attempting to retrieve the list of MS Teams chats for a different user, however no matter which id I pass to GET /beta/users/{id}/chats the response is always the list of chats for the authenticated user. How do you get the list of chats for a different user?

API 文档(https://docs.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-beta&tabs=http) 建议我应该能够调用 GET/beta/me/chats 检索我的聊天列表,GET/beta/users/{id}/chats 检索其他人的聊天列表.

The API documentation (https://docs.microsoft.com/en-us/graph/api/chat-list?view=graph-rest-beta&tabs=http) suggests that I should be able to call GET /beta/me/chats to retrieve the list of my chats and GET /beta/users/{id}/chats to retrieve the list of someone else's chats.

通过实验,我注意到我可以为 {id} 传递任何字符串,并且请求总是成功,响应 200 OK,但带有我的聊天列表.

Through experimentation I've noticed that I can pass any string for {id} and the request always succeeds with response 200 OK, but with my list of chats.

当前不支持检索其他用户所在的聊天列表,这就是不支持应用程序级别权限的原因.

Retrieving the list of chats that another user is a part of isn't currently supported, that's why Application level permissions aren't supported.