You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
scsabelis
5 days agoNew member | Level 1
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
- iNeilDropbox 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:
- API updates to better support team spaces
- Using the Dropbox-API-Path-Root Header
- Identifying Root Namespaces
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 3 hours agoIf 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!