1

I am trying to update the folder name in box.com using curl tool in windows command prompt. However, I am not able to do that and getting the error:

"insufficient permissions".

Following is the exact curl command I am using with the request parameters for updating the folder:

curl -i https://api.box.com/2.0/folders/0 -H "Authorization: Bearer rn4lh6kST6bhmaLEuZdjMtxXpTfORg1B" -d "{\"name\":\"New Folder Name!\"}'-X PUT 

And I am getting the following error:

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

I get the same error for "DELETE" the folder command in curl.

Can anyone please help me with this?

1 Answer 1

2

I believe your issue is with the quote escaping. Also, you have -d "....' (note the mismatched " and '

Try the following commands that are from Box API: (Don't forget to add your folder ID & Access Token)

Update Folders

curl https://api.box.com/2.0/folders/FOLDER_ID 
-H "Authorization: Bearer ACCESS_TOKEN" -d '{"name":"New Folder Name!"}' -X PUT

Delete Folders

curl https://api.box.com/2.0/folders/FOLDER_ID?recursive=true 
-H "Authorization: Bearer ACCESS_TOKEN" -X DELETE
Sign up to request clarification or add additional context in comments.

2 Comments

' quote was a mistake I corrected in my syntax. The curl commands you have given can't be run on windows command prompt, as windows read the ' and " in different manner. So I was using escape character. Anyways I really appreciate you for the response you have given, also would like to mention that my error has been resolved. I was giving folder id as "0". I had to give the specific folder id under parent ("0"). Could you tell me the way to delete multiple folders at one go in box?
You can use [cygwin.com/](Cygwin) to install cURL and other unix commands on Windows. Im not sure how to do it in 'one go'. Couldn't you just have the multiple commands be back to back?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.