0

我正在尝试通过 API 访问我的盒子应用程序,我在“邮递员”中编写了以下 API 行:

https://www.box.com/api/oauth2/authorize?response_type=code&client_id=MY_CLIEN_ID&redirect_uri=https://127.0.0.1

然后我得到 BOX 登录窗口我填写字段并单击授权按钮接下来我得到以下框窗口:“通过访问您的 Box 帐户,“SharingFileSystem”(我的应用程序的名称)可以:读取和写入所有文件和文件夹” 带有按钮“授予对框的访问权限”

当我单击此按钮(授予对框的访问权限)时,我得到“服务器拒绝连接”。

我需要做什么才能通过 API 成功连接到 BOX?

4

2 回答 2

0

您现在可以使用Postman 打包应用程序版本来获取 OAuth 2 的访问令牌。帮助您避免设置服务器的麻烦。

于 2013-10-20T17:27:00.860 回答
0

Box is trying to redirect you back to a webserver listening on localhost, as you've specified in the request. This is the Handling the Response from Box part of the OAuth2 workflow. You have two options here:

  1. For a web-based application, run a webserver on localhost that can handle the HTTP redirect from Box, or
  2. For a client application, register a custom scheme for your application in your OS. This can be any arbitrary name, e.g. foo. Use that custom scheme in the redirect_uri field of your original request to Box: redirect_uri=foo://bar. Your OS will then send the redirect parameters to your application.
于 2013-10-19T21:52:36.423 回答