【问题标题】:Create Folder on onedrive using Oauth Authentication使用 Oauth 身份验证在 onedrive 上创建文件夹
【发布时间】: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

我已经为身份验证过程生成了刷新令牌,但仍然遇到此身份验证错误问题。请帮助解决此问题。

【问题讨论】:

标签: rest office365 office365api


【解决方案1】:

我从未使用过此 API,但 the docs that you provided 没有声明令牌应在 Authorization HTTP 标头中发送,而不是作为查询参数发送?

像这样:

POST https://graph.microsoft.com/v1.0/me/drive/root/children
Content-Type: application/json
Authorization: Bearer put_your_token_here

{
  "name": "Test",
  "folder": { }
}

【讨论】:

  • 嗨,有人在吗?请问你能帮我吗
  • 您没有提供足够的信息。如果您希望有人帮助您,则需要提供更多背景信息。请参阅How do I ask a good question? 指南。显然,您在拨打电话时没有经过身份验证,所以问题在于您如何进行身份验证。你在你的帖子里描述过吗?没有。
猜你喜欢
  • 1970-01-01
  • 2019-12-04
  • 1970-01-01
  • 1970-01-01
  • 2019-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-02
  • 2014-05-25
相关资源
最近更新 更多