【发布时间】:2016-10-21 15:54:49
【问题描述】:
我正在尝试使用 OAuth 授权流程在 OneDrive 上创建文件夹或文件,请求和响应详细信息如下,
请求:-
POST https://graph.microsoft.com/v1.0/me/drive/root/children?
Content-Type: application/json
Authorization: Bearer
{
"name": "Test",
"folder": { }
}
我收到以下错误
回应
{
"error": {
"code": "unauthenticated",
"message": "The caller is not authenticated.",
"innerError": {
"request-id": "44a22daf-7c96-4a27-93d7-77df426c9229",
"date": "2016-10-12T06:32:43"
}
}
}
供参考:- http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_post_children
我已经为身份验证过程生成了刷新令牌,但仍然遇到此身份验证错误问题。请帮助解决此问题。
【问题讨论】:
-
嗨,有人在吗?
-
显然您无权执行此操作。你如何传递令牌?
-
根据文档,您应该在请求中添加
Authorization: Bearer <your OAUTH token>标头。我在您发布的请求中没有看到这一点。 -
那么请更新您的帖子。您是否遵循graph.microsoft.io/en-us/docs/platform/rest 中描述的身份验证程序?
标签: rest office365 office365api