Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
chemical21
7 years agoExplorer | Level 4
I need a clean working example of CREATE FOLDER
I tested many examples, but always get a issue about some missing parameter. For a beginer on this, like me, it became frustative. A clean example like "url-dropbox-api- functio+key+secret+token+fold...
Greg-DB
Dropbox Community Moderator
7 years agoTo use the Dropbox API via JavaScript, we recommend using the official Dropbox API v2 JavaScript SDK.
Creating a folder with that can be done similarly to the filesListFolder example (which is written for Node).
It would look like this, using the filesCreateFolderV2 method: (written for browser JavaScript, assuming the library is already loaded)
var dbx = new Dropbox.Dropbox({ accessToken: ACCESS_TOKEN });
dbx.filesCreateFolderV2({path: '/MyFolderName'})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.error(error);
});
rajshree1996
6 years agoExplorer | Level 3
can we use unique parent folder id then folder name for creating folders?
is there any other way of creating without passing the whole path? with some unique key
- Greg-DB6 years ago
Dropbox Community Moderator
rajshree1996 No, unfortunately the Dropbox API doesn't currently support creating folders using paths relative to existing folder IDs, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
It does support creating new folders relative to namespace IDs though, like:
dbx.filesCreateFolderV2({"path": "ns:123456789/new folder name"}) .then(function(response) { console.log(response); }) .catch(function(error) { console.log(error); });That only works for folders with namespace IDs though, e.g., shared folders.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!