We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

YanivB's avatar
YanivB
Helpful | Level 6
2 years ago

SwiftyDropbox - retrieve the paths of all files and folders in the root directory

Hi all, 

I need help, I have set the SwiftyDropbox SDK in my IOS project, and I am able to do the OAuth process successfully :



and i get my dropbox account info when i ask the API:


I have problem retrieve the paths of all files and folders in my dropbox root directory....
I used this code:

And i get this response :

0 entries.... 
What am I doing wrong, as i have in my dropbox root a lot of folders and files...... ?





5 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    2 years ago

    Hi YanivB,

    Is it certain that the response you got comes from the code you think? 🤔 It doesn't look so (there are some differences). Make it sure. Wipe out of your code all similar looking functions that may be called by mistake instead of the target one (or make their names significantly different so to be difficult make mistake). 😉

    Good luck.

  • YanivB's avatar
    YanivB
    Helpful | Level 6
    2 years ago

    I dont see any mistake .....

    1. The dropboxOAuth() func, returned me the Token i need for later use.
    That is working and I can re-Auth with that Token later.

    2. The getCurrentAccountDropboxInfo()func, also working as i am getting all my account info when I run it.

    3. What i have problems is the listFilesInRootDropbox()func....as its working but I got this response (which doest make sense to me as I expected to get the list of all my folders and files in the the Root of my Dropbox folder.....:

     



     

     




     

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    2 years ago

    Hm... 🤔 Ok, but the result gets printed out from "line 3177" on one side and code you show appears on "line 322"on other side. Isn't a bit strange? 🧐

  • YanivB's avatar
    YanivB
    Helpful | Level 6
    2 years ago

    no no , the name/num of the "line 3177" is random text not the real code line number.
    I get why confused , but that is irrelevant for the response i get from API.
    Can anyone clarify it for me ?

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

    YanivB I see you're getting an empty list back from listFolder, so it looks like you may be using an app with the "app folder" access type. Apps with the app folder access type can only access the app folder automatically created for it. App folders are empty by default, so you would initially get an empty listing like this.

     

    If you want to access the rest of your account, not an app folder, you'd need to switch to using an app with the "full Dropbox" access type instead. If you do so, be sure to reauthorize with the full Dropbox app to get an access/refresh token for that app instead.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,035 PostsLatest Activity: 7 years ago
410 Following

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 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!