We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

sosnos's avatar
sosnos
Explorer | Level 4
5 years ago

Download on scoped app

I got a Scoped App (App Folder) where I put a JPG image and now I want to download it with my Javascript app, on a Node JS environment.

When I try to use the "filesDownload" method, I get the error "Error in call to API function "files/download": Path root is not supported for sandbox app.". I'm calling the function with a path argument "/Applicazioni/MyRepo/MyImage.jpg" (Applicazioni would be italian for Apps) which is the path that the Dropbox App Console created automatically when I generated the App. I tried changing the path using Apps, I tried removing the path and leaving just the file name, but nothing works. What could be the problem here?

Thanks!

  • This error message indicates that your API app has the "app folder" access type, but you're supplying the "Dropbox-API-Path-Root" header. For example, in the Dropbox API v2 JavaScript SDK, you might be setting that via the pathRoot option on the Dropbox object.

     

    Apps with the app folder access type are restricted to their own app folder, and so cannot access other roots. That being the case, you should not attempt to set another path root when using an access token for an app with the app folder access type, so don't set the pathRoot option.

     

    Also, regarding your path value, note that you should not include the path to your app folder itself. To access a file in your app folder, you would just use a path relative to the app folder, like "/MyImage.jpg".

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    This error message indicates that your API app has the "app folder" access type, but you're supplying the "Dropbox-API-Path-Root" header. For example, in the Dropbox API v2 JavaScript SDK, you might be setting that via the pathRoot option on the Dropbox object.

     

    Apps with the app folder access type are restricted to their own app folder, and so cannot access other roots. That being the case, you should not attempt to set another path root when using an access token for an app with the app folder access type, so don't set the pathRoot option.

     

    Also, regarding your path value, note that you should not include the path to your app folder itself. To access a file in your app folder, you would just use a path relative to the app folder, like "/MyImage.jpg".

    • sosnos's avatar
      sosnos
      Explorer | Level 4

      That was it, I was setting it via the dbx.pathRoot attribute because I followed the guide on GitHub. Thanks for your help!

    • BillyVail's avatar
      BillyVail
      New member | Level 2

      This fix didn't work for me! I still get the error 😞

    • BillyVail's avatar
      BillyVail
      New member | Level 2

      Not sure if I posted it correctly? but anyway...

      This fix didn't work for me! I still get the error 

       

      Kind Regards,

      Billy

       

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 6 hours ago
325 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!