Microsoft Graph API - 文件邀请端点突然不起作用

问题描述:

问题:在邀请用户/向项目添加权限时,通过消息获取 400 - 请求格式错误或不正确.这在较早前有效,现在已停止工作.

Issue: While Inviting user/Add permission to Item,Getting 400 with message - The request is malformed or incorrect. This was worked earlier and stopped working now.

文章: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_invite

发布网址:

POST /v1.0/me/drive/items/01B6CXZGZ7RGHIXZBXKNCZB747AVB52EQ2/invite HTTP/1.1 
Host: graph.microsoft.com 
Connection: keep-alive
Content-Length: 213 
Pragma: no-cache
Cache-Control: no-cache 
Accept: application/json, text/plain, / 
Origin: https://developer.microsoft.com

有效载荷:

{ 
    "recipients": [{ "email": "ryan@contoso.com" }],
    "message": "Here's the file that we're collaborating on.", 
    "requireSignIn": false, 
    "sendInvitation": true, 
    "roles": [ "read" ]
}

回复:

{ 
    "error": { 
        "code": "invalidRequest", 
        "message": "The request is malformed or incorrect.", 
        "innerError": { 
            "request-id": "c8a02a02-299c-4ace-8e40-dbd6f830d9ba", 
            "date": "2018-05-17T11:38:00"
        }
    }
}

PD:我们也测试过graph api的beta版本,响应与v1.0相同

PD: We also have tested the beta version of the graph api, and the response is the same than with the v1.0

好像几天没工作了,今天下午他们恢复了服务,现在又可以了

It seems after some days without working, this afternoon they have restored the service and now it works again