【发布时间】:2020-08-18 02:40:11
【问题描述】:
使用 Microsoft 图形 API,我会收到每条 MS Teams 消息的 webhook 通知。当收到以下格式的带有文件附件的消息时:
"attachments": [
{
"id": "aa567f71-4702-4b43-b756-2f453ddb662a",
"contentType": "reference",
"contentUrl": "... the url",
"content": null,
"name": "my file.xlsm",
"thumbnailUrl": null
}
],
然后我尝试调用图形 API 以检索文件信息并使用上面的 id (https://graph.microsoft.com/v1.0/groups/" + teamId + "/drive/items/" + id) 对其执行操作(特别是删除)并获取错误(找不到资源)。我猜我在附件中获得的 id 不是文件项 ID。有没有办法使用图形 API 从附件 ID 中获取项目 ID?
【问题讨论】:
-
你能看看List driveItems using Graph API吗?要获取attachment in Group,您可以关注此。
标签: microsoft-graph-api microsoft-teams sharepoint-api