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

Forum Discussion

IlikeToDevelopS's avatar
IlikeToDevelopS
Explorer | Level 4
7 years ago
Solved

Not returning a list of folders? Only returning random data?

hi there,

I am having trouble getting a list of folders from my dropbox, the following is the main piece of code i use to get a connect/data. So far just getting metadata and not the folders or anyt data that I need. This is being implemented in NodeJS.

let dropb = Dropbox.authenticate({ token: '******' });

let variable = dropb({

      resource: 'files/list_folder',

      parameters: {

                 'account_id': 'dbid:*****',

                 'path': '',

          }

});

//somewhere after console.log(data) //which displays the above code's data in console

Thanks!

  • Greg-DB's avatar
    Greg-DB
    7 years ago

    No, unfortunately there isn't a way to make the API return folders only, but I'll pass this along as a feature request. 

3 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    Can you elaborate on what exactly isn't working for you? What data specifically are you looking for?

    The /2/files/list_folder endpoint is expected to returned the metadata for the files and folders located under the path you specify.

  • IlikeToDevelopS's avatar
    IlikeToDevelopS
    Explorer | Level 4
    7 years ago

    Hi There Greg,

    Sorry I figured out the problem it was something to do with my end of the configuration, quick follow up question which is:

    Is there a way to set the parameter so it only will return folders?

    I see in the data that is returned using that call you mentioned that there is a field called '.tag', is there a way to make it so '.tag' = 'folder' and only return that data?

    Thanks Greg

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    No, unfortunately there isn't a way to make the API return folders only, but I'll pass this along as a feature request. 

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with 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!