cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know all about tools for creatives that work seamlessly with Dropbox, like Adobe? Well, check it out right here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I need a clean working example of CREATE FOLDER

I need a clean working example of CREATE FOLDER

chemical21
New member | Level 2

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+folderToCreate" in a lite javascript function without any jquery on this. You know?: the clear way to something. Even a static example, just for testing. I´ll apreciate so much.

 

Thank you..

 

Elias

3 Replies 3

Re: I need a clean working example of CREATE FOLDER

Greg-DB
Dropboxer

To 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);
  });

 

 

Re: I need a clean working example of CREATE FOLDER

rajshree1996
Explorer | 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

Re: I need a clean working example of CREATE FOLDER

Greg-DB
Dropboxer

@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.

Poll
Do you work or study in the creative industry? If so, which area?
If you use Adobe, don't forget to check out our latest integrations update here.
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    rajshree1996 Explorer | Level 3
What do Dropbox user levels mean?
Need more support?