cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

How to get list of files in root folder or in any folder with API v2

How to get list of files in root folder or in any folder with API v2

Peter K.23
New member | Level 1

Using the example below:

    client.files.listFolder(path: "").response { response, error in
                if let result = response {
                    print("Folder contents:")
                    for entry in result.entries {
                        print(entry.name)

 

returns nothing (or rather nil for the response var), and understanding this represents ROOT folder, and I get this error:

Bad Input: Error in call to API function "files/list_folder": request body: could not decode input as JSON

So ... I was able to upload a file, so the token is good, but any list, either files or shared, returns nothing.  Guessing something not set correct either in the account or this api ... thanks for your help !

 

 

 

2 Replies 2

Greg-DB
Dropbox Staff

This is a bug in version 2.0.3 of the SwiftyDropbox library. Upgrade to the latest version, currently 3.0.0, and try again.

Peter K.23
New member | Level 1

Thanks for the update and I have confirmed that v3.0 is working great.

 

Thanks again.

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Peter K.23 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?