cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

Getting multiple thumbnails of multiple files at once ?

Getting multiple thumbnails of multiple files at once ?

neunygph
Explorer | Level 4

Is it possible to retrieve multiple thumbnails of multiple files at once ? I tried to make a request to https://photos.dropbox.com/thumbnails_batch just like the guide from https://blogs.dropbox.com/tech/2014/01/retrieving-thumbnails/ but it doesnt' work and I'm not sure if I did it wrong or this end point is no longer supported. 

 

I tried to make a get request to https://photos.dropbox.com/thumbnails_batch?paths= /path/to/thumb0.jpg,/path/to/thumb1.jpg,[...],/path/to/thumbN.jpg but it showed 4xx error. Please advice if I missed anthing from this request.

 

Thank you

27 Replies 27

Greg-DB
Dropbox Staff

That's a way of calling the API endpoint and supplying the credentials on the URL itself (instead of in a header), but the API call still returns the thumbnail data directly.

 

API v2 does also offer a way to do this as well as documented here under "Content-download endpoints" (i.e., using the 'authorization' and 'arg' URL parameters).

 

It's important to note thought that while it does technically produce a single URL that returns a thumbnail that can be accessed just via a GET request, it should be used with caution, as it could leak the access token. For example, you shouldn't use this technique client-side if the thumbnails are being shown to anyone other than the owner of the files, as the links contain the access token.

neunygph
Explorer | Level 4
Oh I see, thanks Greg for helping me to know more about the v2 API.

Phuong

neunygph
Explorer | Level 4
Hi Greg,

One more question please. I tried a get request to this endpoint https://content.dropboxapi.com/1/thumbnails/auto/IMG_8199.jpg with authentication token in the header and it works great. My question is: Will this get endpoint continue to be supported after 6/28/2017 when the api v1 is turned off since the end point host is from v2 but it still contain 1/ in the url. Please advice.

Thanks,

Greg-DB
Dropbox Staff
The /1/thumbnails endpoint is part of API v1 and will not be available after API v1 is retired. (The different hosts, e.g., api-content.dropbox.com and content.dropboxapi.com, are not tied to specific versions of the API. They each currently serve both API v1 and API v2.)

neunygph
Explorer | Level 4
Oh ok, thank you very much.

Phuong

neunygph
Explorer | Level 4
Hi Greg,

You mentioned that the api v2 does offer a way to get thumbnail as v1 (https://content.dropboxapi.com/1/thumbnails/auto/IMG_8199.jpg?size=s&access_token={mytoken}. I tried it but it never worked for me without /1/thumbnails, I even tried to replace /1/thumbnails with /2/get_thumbnail but no use. Do you have any example url/endpoint where it's showing access token from the url other than the one from v1 so I can look at ?

Thanks,

Greg-DB
Dropbox Staff

The different versions of the API work differently, so it won't be a matter of just replacing /1/thumbnails with /2/get_thumbnail. For API v2, you'll need to use the 'authorization' and 'arg' URL parameters, per the documentation I linked to earlier:

 

https://www.dropbox.com/developers/documentation/http/documentation#formats

 

For example, getting the thumbnail for a files at /test.jpg would look like this:

 

https://content.dropboxapi.com/2/files/get_thumbnail?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%20%22%2Ftest.jpg%22%2C%22format%22%3A%20%22jpeg%22%2C%22size%22%3A%20%22w64h64%22%7D

neunygph
Explorer | Level 4
Hi Greg,

I tried the provided url with my token and an actual image path, but I got a weird error message saying "Error in call to API function "files/get_thumbnail": Your app is not currently allowed to use API v2". Wonder how this happens since I have been using v2, it's not that my app is still on development mode, I haven't submitted/requested for production yet. Wonder if this is why.

Thanks,

Greg-DB
Dropbox Staff
That error isn't related to your app's development or production status. Did you potentially use an access token for an app with the "file type" permission though (as opposed to full Dropbox or app folder)? The file type permission isn't supported by API v2.

neunygph
Explorer | Level 4
I replaced the token and it worked, but I'm actually looking for endpoint that return image/jpeg or image/png Content-Type like v1, not application/octet-stream. Is it even possible to do it with the api v2 ?

I am aware that the api does not support returning thumbnails/templinks in bulk from the thumbnail and templink end points. But since the api support returning metadata in bulk from the list_folder endpoint, therefore I wonder if there is a way to include templinks or thumbnails from list_folder response that is not defined from the official api document.

Thanks,
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    neunygph Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?