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: 

Dropbox Chooser link error

Dropbox Chooser link error

Андрей Г.2
Explorer | Level 4

Hi, I use dropbox Chooser on my site, the user inserts links to images from Chooser and sometimes these links return 403 code. What can this be related to.
Example link: https://dl.dropboxusercontent.com/1/view/0bh390k3ngjcm4u/Pre-Media/Clipping/PicUp%20Media/2020/5/5-3...

5 Replies 5

Greg-DB
Dropbox Staff

It sounds like you're using the "direct" link type. Those links do expire after four hours. You can use the "preview" link type instead though, which don't expire. You can find more information in the Chooser documentation:

 

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

 

You can also modify the "preview" links for different behaviors, if needed, as documented here:

 

https://help.dropbox.com/files-folders/share/force-download

Андрей Г.2
Explorer | Level 4

no reason for that, the images are uploaded 5 minutes after the user has added them

Greg-DB
Dropbox Staff

Thanks for the additional information. In that case, it's likely due to a restriction that can be set on Dropbox Business teams that prevents links from being accessed outside of the team.

 

By default, these links are accessible without authentication, but Dropbox Business team admins can optionally enforce additional access controls on links for their users in general, which also apply to the links as returned by the Chooser. You can find more information on this restriction here:

 

https://www.dropbox.com/help/504

 

You can detect the failure to access the file content via these links using the status code they return. (I.e., 200 would indicate success, and 4xx, in this case 403, which indicate failure.)

 

Unfortunately, we don't have a good solution right now for using the Chooser from accounts that are part of Dropbox for Business teams where the admin has enabled restrictions on shared links like this, but I'll send this along to the team to look into how to potentially improve this.

 

That being the case, one alternative right now is to use the HTTP API instead, where the /files/download call isn't subject to the same restrictions as the authorized access token allows you direct access to the user's account:

 

https://www.dropbox.com/developers/documentation/http/documentation#files-download

 

That would be substantially more work to implement though.

Андрей Г.2
Explorer | Level 4

if I use link type = "preview" and delete "? dl = 0" from the generated link then such link will be active always? do I need to add the parameter raw = 1?

Greg-DB
Dropbox Staff

No, the Business team restriction will still apply in that case.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Андрей Г.2 Explorer | Level 4
What do Dropbox user levels mean?