cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

PDF thumbnail URL instead of the file

PDF thumbnail URL instead of the file

vbarzokas
Explorer | Level 3

Hi, I am using the API v2 and trying to retrieve the thumbnail URL of PDF files so I can use them inside <img> tags of my HTML code.

Currently I use this endpoint and headers:

POST https://content.dropboxapi.com/2/files/get_thumbnail
Authorization: Bearer <access token>
Dropbox-API-Arg: {"path": "/<path to file>.pdf", "format": "jpeg", "size": "w64h64", "mode": "strict"}


and as a response I get the binary data of the file itself, so in my use case I have to download it, store it and then provide it in my HTML code as an image link, which is not optimal and I would like to avoid.

I wonder if there is any other endpoint or option that can give me back a Dropbox API hosted URL of the thumbnail instead of the file itself.

Thank you,
Vassilis

PS: The documentation page at https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail is kind of outdated as it looks like it refers to a previous API version which was returning a JSON object.

 

3 Replies 3

Greg-DB
Dropbox Staff
No, unfortunately the Dropbox API does not offer thumbnail links, but I'll pass this along as a feature request.

Also the documentation at https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail is correct. Note that this is a "Content-download" style endpoint. The "ENDPOINT FORMAT" section in that documentation indicates that, and links to more documentation that explains that format. (In short, it returns metadata as JSON in a response header, and the requested data in the response body.)

cmo2
New member | Level 2

But your Chooser does show PDF thumbnails. So is that you're using a private API for your own file chooser, but third party devs can't access the same API for their own file pickers? 

Greg-DB
Dropbox Staff
Yes, the Chooser uses a different mechanism than the Dropbox API.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    cmo2 New member | Level 2
What do Dropbox user levels mean?