1

Box API 経由でフォルダーを作成しようとしています。私のリクエストは次のようになります。

-------------- REQUEST  --------------
POST https://api.box.com/2.0/folders/0
Accept-Encoding: gzip
Authorization: Bearer [hidden]
User-Agent: Google-HTTP-Java-Client/1.14.1-beta (gzip)
Content-Type: application/json; charset=UTF-8
Content-Length: 36

-------------- REQUEST BODY ----------
{"name":"test2","parent":{"id":"0"}}

-------------- RESPONSE --------------
HTTP/1.1 403 Forbidden
Date: Wed, 10 Apr 2013 21:15:53 GMT
Content-Length: 224
Content-Type: application/json
Connection: keep-alive
Server: nginx
Cache-Control: no-cache, no-store

-------------- RESPONSE BODY----------
{"type":"error","status":403,"code":"access_denied_insufficient_permissions","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Access denied - insufficient permission","request_id":"19725779175165d68967049"}

誰かが私のリクエストの何が問題なのか説明できますか? 同じ Bearer ヘッダーを持つ他のリクエストへの応答で、正しい結果を受け取ります。

-------------- REQUEST  --------------
GET https://api.box.com/2.0/folders/0
Accept-Encoding: gzip
Authorization: Bearer [hidden]
User-Agent: Google-HTTP-Java-Client/1.14.1-beta (gzip)

-------------- RESPONSE --------------
HTTP/1.1 200 OK
Date: Wed, 10 Apr 2013 21:15:53 GMT
Transfer-Encoding: chunked
Content-Encoding: gzip
Content-Type: application/json
Connection: keep-alive
Server: nginx
Cache-Control: no-cache, no-store

私のアプリケーションは、読み取りと書き込みのアクセス許可を要求するように構成されています。

4

2 に答える 2

3

から URL を変更していただけますか

https://api.box.com/2.0/folders/0

https://api.box.com/2.0/folders

于 2013-04-12T08:01:58.473 に答える
-1

C#.net を使用して Box.net にフォルダーを作成する場合

static string folderCreation(string APIKey, string authToken) {

    RestClient client = new RestClient();
    client.BaseUrl = "https://api.box.com/2.0/folders";
    var request = new RestRequest(Method.POST);
    string Headers = string.Format("Bearer {0}", authToken);
    request.AddHeader("Authorization", Headers);
    request.AddParameter("application/json", "{\"name\":\"Youka\",\"parent\":{\"id\":\"0\"}}", ParameterType.RequestBody);
    var response = client.Execute(request);
    return response.Content;



}
于 2014-02-25T12:59:47.450 に答える