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

JSON Batching not working with some Microsoft Teams API

我们正在尝试使用此请求的 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 吗?

Teams Graph 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"
    }
  ]
}