如何获取一个驱动器 API 的访问令牌以上传文件?
How to get access token for one drive API to upload a file?
我正在创建一个应用程序,我想调用 OneDrive 的 API 来上传文件。 Here is the link to page and API I am using is : https://apis.live.net/v5.0/me/skydrive/files/HelloWorld.txt?access_token=ACCESS_TOKEN
我按照 link 按照 "code flow" 执行了所有步骤 here and got the access token as in response, but it say's 'invalid access token' after using it while running the same API. Here 是我尝试过的屏幕截图。
我很困惑在 API 中使用哪个标记。我在哪里可以成功地从 ACCESS_TOKEN 到 运行 'upload file' API?
问题已解决。 运行 跟随 API ,我们应该在范围内添加 onedrive.readwrite 以通过 API.
上传文件
Here 是从 'code flow'.
创建访问令牌的步骤
https://login.live.com/oauth20_authorize.srf?client_id={client_id}&scope={scope}&response_type=code&redirect_uri={uri}
我正在创建一个应用程序,我想调用 OneDrive 的 API 来上传文件。 Here is the link to page and API I am using is : https://apis.live.net/v5.0/me/skydrive/files/HelloWorld.txt?access_token=ACCESS_TOKEN
我按照 link 按照 "code flow" 执行了所有步骤 here and got the access token as in response, but it say's 'invalid access token' after using it while running the same API. Here 是我尝试过的屏幕截图。 我很困惑在 API 中使用哪个标记。我在哪里可以成功地从 ACCESS_TOKEN 到 运行 'upload file' API?
问题已解决。 运行 跟随 API ,我们应该在范围内添加 onedrive.readwrite 以通过 API.
上传文件Here 是从 'code flow'.
创建访问令牌的步骤https://login.live.com/oauth20_authorize.srf?client_id={client_id}&scope={scope}&response_type=code&redirect_uri={uri}