500错误获取团队频道消息(MS-Graph Beta)

时间:2019-10-23 18:40:40

标签: microsoft-graph microsoft-graph-teams

我一直在使用Graph的Beta API在Teams中操纵消息。从10/16开始,执行这些操作时出现错误。我终于找到了它,直到在

中通过任何API调用获得500条消息

获取/ teams / {id} / channels / {id} / messages

同一呼叫,省略了/messages,可以正确返回频道信息。

例如

Invoke-RestMethod "https://graph.microsoft.us/beta/teams/$teamID/channels/$chanID/" -Method Get -Headers $head

返回通道实体对象,但

Invoke-RestMethod "https://graph.microsoft.us/beta/teams/$teamID/channels/$chanID/messages" -Method Get -Headers $head

返回以下错误(来自提琴手的完整数据)

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: application/json
request-id: 83ef77bb-5fa5-4277-939d-c192e7900c0e
client-request-id: 83ef77bb-5fa5-4277-939d-c192e7900c0e
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"USGov Iowa","Slice":"SliceC","Ring":"5","ScaleUnit":"001","RoleInstance":"AGSFE_IN_3"}}
Strict-Transport-Security: max-age=31536000
Date: Wed, 23 Oct 2019 18:33:43 GMT
Content-Length: 231

{
  "error": {
    "code": "InternalServerError",
    "message": "Failed to execute request.",
    "innerError": {
      "request-id": "83ef77bb-5fa5-4277-939d-c192e7900c0e",
      "date": "2019-10-23T18:33:43"
    }
  }
}

我做错什么了吗?

我在GCC高级环境中。

谢谢 戴夫

1 个答案:

答案 0 :(得分:0)

您是否正在使用“应用程序”权限?如果是这样,则此终结点以及大多数其他消息终结点(发送消息除外)都属于团队内受保护的API,因此您需要申请访问权限才能使用这些API。

https://docs.microsoft.com/en-us/graph/teams-protected-apis