Take Your Search Game to the Next Level with Dropbox Dash  🚀✨ Curious how it works? Ask us here! 

Forum Discussion

Rich F.5's avatar
Rich F.5
New member | Level 2
3 months ago
Solved

Can't Find Files in Ruby dropbox_api

Hi folks.  I have an API issue here.  

I'm using the Ruby gem dropbox_api

I've registered a Dropbox project for a folder in my Dropbox root path.  I can't seem to list the files inside that root.  

  • Full permissions set
  • auth token is working fine
    • I can get my account using this token
  • There are two files in this project root folder, but it's reporting no files in there at all

I simply cannot find any files nor folders at all, and I don't know why.  The gem's Issues on github don't show any issues that are related.  So I'm assuming the gem is working properly, with nearly 4 million downloads.  I'm assuming I'm doing something wrong.

I've triple checked all this and even Gemini 2.0 has said it has nothing more to suggest other than post in here.  That's pretty solid.

So anybody with any insight, please tell me what you want to see as I can't get past any of this.  

Cheers

  • iNeil's avatar
    iNeil
    3 months ago

    Hello Rich F.5,

    When you use an access token from an API app with the “app folder" access type, you are correct that the root path of your API calls refers to your app's dedicated folder. For example, if I create an API app named “TestAppFolder” with the “app folder” access type, I will only have access to the folder located at the path /Apps/TestAppFolder while using the access token connected to that API app. If the app folder "TestAppFolder" is empty, no files or folders will be listed when calling the Dropbox API.

    Would you be able to cross-check if the app folder you're attempting to access contains any files or folders?

    Please note that when using an API app with access type 'app folder', each user gets their own separate app folder in their account when they authorize the app to connect. The app folders for different users of an app do not sync with each other. 

11 Replies

  • Rich F.5's avatar
    Rich F.5
    New member | Level 2

    Update.  Some troubleshooting.

    I created a new project for Full Dropbox viewing.  I did the same listing and it reported correctly:

    result = client.list_folder('/project_dropbox')

    So the issue seems to be choosing a root subdirectory when making a focussed project focus.  Is this a known issue?  I've given it the correct subdirectory name, but it won't see any files.  

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hello Rich F.5,

    I'm happy to hear that you are able to access your files and folders while using an API app with the access type 'Full Dropbox.' Please note that the Dropbox API currently offers two levels of file access: 'App Folder' and 'Full Dropbox'. May I ask if you have initially created an API app with the access type  'App Folder'?

    If you have created an API app with the access type 'App Folder,' it can only access the contents of a dedicated folder named after the API app. For further information, please review the following link:

    - https://www.dropbox.com/developers/reference/developer-guide 

  • Rich F.5's avatar
    Rich F.5
    New member | Level 2

    Hi there.  Yes I have created both just to test them.  I simply cannot get the 'App Folder' to work.  The problem is that nothing is showing up.  I'm assuming the following, and please clarify this: When using 'App Folder', the base url is root, basically pointing to the associated folder in the Dropbox console?  I'm clear on the difference between both, it's just that I can't get any results.  

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Hello Rich F.5,

      When you use an access token from an API app with the “app folder" access type, you are correct that the root path of your API calls refers to your app's dedicated folder. For example, if I create an API app named “TestAppFolder” with the “app folder” access type, I will only have access to the folder located at the path /Apps/TestAppFolder while using the access token connected to that API app. If the app folder "TestAppFolder" is empty, no files or folders will be listed when calling the Dropbox API.

      Would you be able to cross-check if the app folder you're attempting to access contains any files or folders?

      Please note that when using an API app with access type 'app folder', each user gets their own separate app folder in their account when they authorize the app to connect. The app folders for different users of an app do not sync with each other. 

  • Rich F.5's avatar
    Rich F.5
    New member | Level 2

    OK I just had a look.  I had a /myfolder and just found /Apps/myfolder paths.  The true dropbox link I provided was for the first, which is why I cannot see this.  This needs to be clear in documentation that these direct folders show up in /Apps.  I will test this out.  

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Hello Rich F.5, Thanks for the feedback! I'll pass this along to our development team to improve the documentation on the 'app folder' access type, regarding the direct path of the app folder within a Dropbox account.

  • Rich F.5's avatar
    Rich F.5
    New member | Level 2

    OK, final question.  If I wanted to use the app folder version, why doesn't the same path go to the location, since the two are the same name?

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Hi Rich F.5

      Please note that each API app name is unique, and no two API apps can have the same name. That said, our team is more than happy to cross-check the issue you are experiencing with your API apps. Please open an API ticket using the following link:

      https://www.dropbox.com/developers/contact

      Please also include the steps to reproduce the issue and the full text of any error or unexpected output you are encountering.

      • Rich F.5's avatar
        Rich F.5
        New member | Level 2

        My point was about how to use the app folder as opposed to Full.  If they are named the same thing (/Apps/myfolder and /myfolder), how can I just use the /Apps/ version?  I want to leave out the full access as that's a security risk as I have it set up now.  I can't seem to set up a project with just /Apps/myfolder access and reference that by using the path '/' given the root of that project is just that.  

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hello Rich F.5 , 

    Thank you for the clarification. If you are using an API app with the access type "App folder," you will only have access to the dedicated app folder named after your app. For example, if your API app is named "myfolder," you can only access the dedicated app folder at /Apps/myfolder and not /myfolder, as it is outside the dedicated app folder assigned to the app.

    Please note that if you are attempting to list the root contents of the dedicated app folder, you should specify the root using an empty string rather than the path "/". While using the access token from the API app with the access type "App folder", you can test the 2/files/list_folder endpoint using our Dropbox API explorer to check the content of the dedicated app folder.

    If you are encountering a particular error, please provide the full text of the error or unexpected output you are encountering and the steps to reproduce the issue.

    • Rich F.5's avatar
      Rich F.5
      New member | Level 2

      Hi there.  

      Yes, the problem is using empty string as root for an app.  I'll check it again, but I reviewed this intensively and couldn't find the files in that directory.  

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers810 PostsLatest Activity: 11 hours ago
248 Following

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!