One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
b_diouf
7 years agoExplorer | Level 3
What format should the "Path" be for Dropbox APIV2
I am trying to upload a file in a path using dropbox api however, using the api explorer via:
I am getting Error 400: for a wrong path I believe.
If I for example have a shared folder path via /Files/SharedPath/Uploads/.
What would be the proper path input to satisfy the example above?
Thanks,
b_diouf
- Jay
Dropbox Staff
Hey there, I moved your thread to the API forum for our specialist to check it out! - Greg-DB
Dropbox Staff
When uploading a file via API v2, the path generally should be the desired destination path for the file, relative to the app's root, using "/"s.
E.g., in your case, it sounds like you'd want to supply "/Files/SharedPath/Uploads/UPLOADME.txt", or whatever you want the name to be.
You can get the paths for existing items using the returned Metadata.path_lower value, e.g., as returned by /2/files/list_folder[/continue] or /2/files/get_metadata.- b_dioufExplorer | Level 3
I've tried so for the path section i should place "/2/files/SharedPath/Uploads/"
I've tried it but it is not working. Maybe you can give me another example of how to enter "path" based on a "/" file example?
Thanks!
- Greg-DB
Dropbox Staff
You should not include "/2/" as part of the path value. That's just part of the API endpoint URL itself.
A valid path would be "/Files/SharedPath/Uploads/UPLOADME.txt" for instance, but it depends on what folders you have in your account of course. Here's an example of how you would upload a file name "resume.docx" to a folder named "Documents": "/Documents/resume.docx".
A good way to work this out is by listing the contents of the account using /2/files/list_folder[/continue] with an empty path to start with:
https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder
https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder/continue
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 days ago
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!