我正在使用
Drive item Invite endpoint
授予现有Azure AD用户对一个驱动器(组一驱动器)文件夹的权限。
根据
documentation
我们可以使用email或objectId向用户授予权限,但是当我用objectId进行调用时,它失败,状态代码为400。如果我打电话给同一个用户相同的权限,它可以处理电子邮件。
以下通话有效
统一资源定位地址
https://graph.microsoft.com/v1.0/drives/b!EbRqdRcmzk21wz2m9sBY5l3vh0lMNqtMhqojqNZdtV3jVfFqN25wQLgxqBe-lMFN/items/01EPSHROTVQE5PIMAEJBCZFOELF7FTKSYE/invite
有效载荷
{"recipients":[{"email":"emailhere"}],
"message":"Test message",
"requireSignIn":true,
"sendInvitation":false,
"roles":["write"]}
统一资源定位地址
https://graph.microsoft.com/v1.0/drives/b!ebrqdrcmzk21wz2m9sby5l3vh0lmnqtmqojqnzdtv3jvffqn25wqlgxqbe lMFN/items/01epshrotvqe5pimajbczfoelf7ftksye/邀请
有效载荷
{"recipients":[{"objectId":"GUID"}],
"message":"Test message",
"requireSignIn":true,
"sendInvitation":false,
"roles":["write"]}
以下是来自图形的对请求id为request-id的失败请求的响应。
{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
"innerError": {
"request-id": "9b492f32-25ca-4a4d-bff1-bcf227fedab7",
"date": "2019-02-28T10:41:14"
}
}
}