Python_Novice
Python_Novice

Reputation: 170

Box.com update/delete folder using curl

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?

Upvotes: 1

Views: 1135

Answers (1)

Bijan
Bijan

Reputation: 8602

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

Upvotes: 2

Related Questions