Skip to main content
Box Employee
May 27, 2025 12:17 PM UTC
Question

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

 

    5 replies

    Box Employee
    May 27, 2025 12:17 PM UTC

    Hi Luis,

    Please share with us how to replicate your experience.

    Is this an OAuth client side or server side (JWT) app?

    Can the user making the call actually see the parent folder where you are trying to create the folder?

    Let us know.

    Translate
    Box Employee
    May 27, 2025 12:17 PM UTC

    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

    Translate
    Box Employee
    May 27, 2025 12:17 PM UTC

    Hello,

    Is there any follow-up to this?

    Thanks!

    Translate
    Box Employee
    May 27, 2025 12:17 PM UTC

    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.

     

    Translate
    Box Employee
    May 27, 2025 12:17 PM UTC

    Of course that curl request isn't going to work. That's why I created the ticket. Do you have any logs on your end?

    Thanks,

     

    Louis

    Translate