遵循本指南:
http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_invite
我发出以下帖子请求:
POST /v1.0/me/drive/items/01OL4PFB56Y2GOVW7725BZO354PWSELRRZ/invite
Accept: */*
Accept-Encoding: gzip, deflate
Content-Type: application/json
Authorization: Bearer eyJ0e....
Accept-Language: es-es
{
"recipients": [
{
"email": "a-real-email@at-a-office365-account.com"
}
],
"message": "Here's the file that we're collaborating on.",
"requireSignIn": true,
"sendInvitation": true,
"roles": [ "edit" ]
}
我得到了这个回复代码:
{
"error": {
"code": "invalidRequest",
"message": "One of the provided arguments is not acceptable.",
"innerError": {
"request-id": "37c754c4-ace7-4582-9c6a-171633d1e335",
"date": "2016-09-29T10:17:18"
}
}
}
这只是文档中的示例,但我尝试使用不同的电子邮件值,删除邮件,sendInvitation = false,我得到相同的错误。我不明白哪个论点不正确。
更新1:
更改'编辑'要写'',我收到此错误:
{
"error": {
"code": "notAllowed",
"message": "The action is not allowed by the system.",
"innerError": {
"request-id": "644408df-05f6-4406-9503-b5c16da17976",
"date": "2016-09-30T12:09:02"
}
}
}
答案 0 :(得分:1)
该角色应该是write
而不是edit
- 看起来我们在文档中有错误。感谢您指出了这一点!我们会修复它。