Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

scsabelis's avatar
scsabelis
New member | Level 1
12 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:

     

1 Reply

Replies have been turned off for this discussion
  • iNeil's avatar
    iNeil
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    12 months ago

    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.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!