API works flawlesslesly except for when creating a folder
I'm able to create a folder in the web interface just fine. I'm using Oath2.0 for my integration, and everything works except for creating a folder. (I get a 403 -- access_denied_insufficient_permissions).
I read through the article here but nothing turned out to be helpful:
https://support.box.com/hc/en-us/articles/360043693434
Any suggestions?
Thanks
-
OAuth 2.0 (bearer token) Server Side.
Yes the user making the call can see the parent folder.
Sample curl request:
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => true,CURLOPT_ENCODING => '',CURLOPT_MAXREDIRS => 10,CURLOPT_TIMEOUT => 0,CURLOPT_FOLLOWLOCATION => true,CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST => 'POST',CURLOPT_POSTFIELDS =>'{"name": "New Folder","parent": {"id": "parentfolderidhere"},"folder_upload_email": {"access": "open"},"sync_state": "synced"}',CURLOPT_HTTPHEADER => array('Content-Type: application/json','Authorization: Bearer bearerTokenHere),));
$response = curl_exec($curl);
curl_close($curl);echo $response;Thanks
-
Hi Louis,
Is this PHP?
I am unable to replicate your case, an have no php experience, so other than a missing quote next to TokenHere I can't help.
Please take a look at this curl example:
curl -i -X POST "https://api.box.com/2.0/folders" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "New Folder",
"parent": {
"id": "0"
}
}'it works fine.
In order to eliminate user permissions, please try to create the folder on the user root folder: 0
It could be related to application permissions though, please check those.
投稿コメントは受け付けていません。
コメント
5件のコメント