JSON批处理不适用于某些Microsoft Teams API

问题描述 投票:1回答:1

我们正在尝试使用此请求的Microsoft Graph的JSON batching

{
  "requests": [
    {
      "id": "1",
      "method": "GET",
      "url": "/me"
    },
    {
      "id": "2",
      "method": "GET",
      "url": "/me/joinedTeams"
    }
  ]
}

我们能够得到/me的回复,但不能回复/me/joinedTeams

{
  "responses": [
    {
      "id": "1",
      "status": 200,
      "headers": {
        "Cache-Control": "no-cache",
        "OData-Version": "4.0",
        "Content-Type": "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
      },
      "body": {
          // valid response here
      }
    },
    {
      "id": "2",
      "status": 400,
      "body": {
        "error": {
          "code": "BadRequest",
          "message": "Unsupported segment type. ODataQuery: users/35036c48-1e5a-4ca4-89f0-2d11c4cf8937/joinedTeams",
          "innerError": {
            "request-id": "a075c4f6-362a-469f-945b-5b46d96784a0",
            "date": "2018-09-12T10:09:40"
          }
        }
      }
    }
  ]
}

批处理不支持Teams API吗?

microsoft-graph microsoft-teams
1个回答
3
投票

团队图API仍处于测试阶段,但您正在使用/1.0端点。它应该在/beta端点上正常工作。

POST https://graph.microsoft.com/beta/$batch
Accept: application/json
Content-Type: application/json
{
  "requests": [
    {
      "id": "1",
      "method": "GET",
      "url": "/me"
    },
    {
      "id": "2",
      "method": "GET",
      "url": "/me/joinedTeams"
    }
  ]
}
© www.soinside.com 2019 - 2024. All rights reserved.