Microsoft Graph API Endpoint" microsoft.graph.createLink"返回400错误

时间:2015-12-01 00:40:13

标签: office365 office365api azure-ad-graph-api microsoft-graph

我尝试根据新的Microsoft Graph API v1发送以下HTTP请求:

POST https://graph.microsoft.com/v1.0/groups/c694da84-3f9f-4bac-9491-c2775fc39f65/drive/items/012YPM4EKO23JQWLSNYJG2DG3ZAULBDCIS/microsoft.graph.createLink HTTP/1.1
Authorization: Bearer <access-code> (filled in with valid access token)
Host: graph.microsoft.com
Content-type: application/json
Content-Length: 53

{
  "type": "edit",
  "scope": "Files.ReadWrite"
}

我的网址遵循以下格式: https://graph.microsoft.com/v1.0/groups/<group-id>/drive/items/<item-id>/microsoft.graph.createLink

我收到以下400错误:

HTTP/1.1 400 Bad Request

{
  "error": {
    "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
    "message": "The parameter scope does not exist in method createLink.",
    "innerError": {
      "request-id": "nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn",
      "date": "2015-11-30T23:55:56"
    }
  }
}

我有点困惑,因为根据以下文档(我认为是最新的),请求正文中需要范围:Microsoft Graph - Create a sharing link for an item

1 个答案:

答案 0 :(得分:1)

卡姆登,

很抱歉这里的回复很晚。是的 - 我们这里有一个错误,正在部署修复程序。我会尝试在可能完成的时候获得ETA。无论如何,一旦完成此请求应该开始工作。也就是说,您的请求中存在错误。 &#34;范围&#34;参数必须设置为&#39; organization&#39;或者匿名的#39;我将在GitHub上提交一个问题来修复文档以提及这一点。

希望这有帮助,