Start 2025 on time and up to date! Seamlessly integrate your calendars into Dropbox with these simple steps! 📆

Forum Discussion

scsabelis's avatar
scsabelis
New member | Level 1
2 months ago
Solved

Creating File request through API in team Folder

Hi,

Using the web console I can create a file request for a folder inside our team root folder.
However when using the API for file requests (using team scoped token and specifying the header "Dropbox-API-Select-User") the file request gets created but the destination folder is using a subfolder of the user's own folder instead of the team folder.

Eg destination = "/TEAMFOLDER/uploads/"
Then the file request created with the API will put the destination at "/USER/TEAMFOLDER/uploads".

The call to the API is as follows:

POST https://api.dropboxapi.com/2/file_requests/create

$headers = [
'Authorization: Bearer API_KEY',
'Content-Type: application/json',
'Dropbox-API-Select-User: MEMBER_ID'
];

$body = [
'title' => "Request for files",
'destination' => "/TEAMFOLDER/uploads/",
'open' => true
];

Using PHP / curl

Thanks in advance,

Simon

 

  • Hi scsabelis

    If your account team configuration is set to the updated team space, API calls to the Dropbox API, by default, operate in the "member folder" of the connected account. 

    To create file requests that use a destination in the "team space" (e.g. /TEAMFOLDER/uploads), you must configure the Dropbox-API-Path-Root header in your API request. Below is an example of the Dropbox-API-Path-Root header you would add to your API request:

    'Dropbox-API-Path-Root: {".tag": "root", "root": "YOUR_ROOT_NAMESPACE_ID"}'

    For more information, please review the following links:

     

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi scsabelis

    If your account team configuration is set to the updated team space, API calls to the Dropbox API, by default, operate in the "member folder" of the connected account. 

    To create file requests that use a destination in the "team space" (e.g. /TEAMFOLDER/uploads), you must configure the Dropbox-API-Path-Root header in your API request. Below is an example of the Dropbox-API-Path-Root header you would add to your API request:

    'Dropbox-API-Path-Root: {".tag": "root", "root": "YOUR_ROOT_NAMESPACE_ID"}'

    For more information, please review the following links:

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,936 PostsLatest Activity: 11 hours ago
346 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!