cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: Download on scoped app

Download on scoped app

sosnos
Explorer | Level 4
Go to solution

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!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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".

View solution in original post

5 Replies 5

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 4
Go to solution

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

BillyVail
New member | Level 2

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

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

BillyVail_0-1698127511396.png

 

Greg-DB
Dropbox Staff

@BillyVail Please feel free to open a new thread with the details of your issue so we can take a look and help you specifically.

Need more support?