We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
neunygph
10 years agoExplorer | Level 4
Getting multiple thumbnails of multiple files at once ?
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
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
That isn't part of the public Dropbox API, which doesn't currently offer a bulk thumbnails call, but I'll be sure to pass this along as a feature request. - neunygph10 years agoExplorer | Level 4Hi Greg,
Thanks for the quick response, I am aware that https://photos.dropbox.com/thumbnails_batch is not a public Dropbox API endpoint but is there a way or any public API end point to get multiple thumbnails at once ?
Thanks, - Greg-DB10 years ago
Dropbox Community Moderator
No, the Dropbox API doesn't currently offer a way to get thumbnails in bulk. - neunygph10 years agoExplorer | Level 4Ah ok, thanks Greg for the info.
- neunygph10 years agoExplorer | Level 4Hi Greg,
I'm trying to get a thumbnail for an image in my account and make a POST request to https://api.dropboxapi.com/2/files/get_thumbnail, and it successfully returned with a status 200, which is good. But from the json response, I do not see any link or url to this thumbnail. Also, regardless what size or format option I put in, the returned data is always showing that the thumbnail is the same size and the format is always the original format when uploaded.
For instance, I uploaded a .jpeg or jpg image. Is it possible to retrieve a .png thumbnail and the size other than the original uploaded size ? And where do I find the link/url for this thumbnail from the response. Please advice.
Thank you - Greg-DB10 years ago
Dropbox Community Moderator
The /2/files/get_thumbnail endpoint returns the raw thumbnail data directly in the response body, not as a URL. You'll want to read the response body out and save or display that as the thumbnail. The API doesn't offer a way to get links for thumbnails, but I'll be sure to pass this along as a feature request.
Also, the JSON in the dropbox-api-result header is the metadata for the original file itself, not the returned thumbnail data.
- neunygph10 years agoExplorer | Level 4Look like the api version 1 support thumbnails url, I'm just wondering when v1 will be deprecated or no longer in use anymore?
- Greg-DB10 years ago
Dropbox Community Moderator
The API v1 /thumbnails endpoint also only returns the data, not a URL.
You can find the deprecation timeline for API v1 here:
https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/
- neunygph10 years agoExplorer | Level 4Hi Greg,
According to the document from https://www.dropbox.com/developers-v1/core/docs#thumbnails, I implemented the api v1 to get an image thumbnail and I got this and I am able to display the thumbnail with this active url https://api-content.dropbox.com/1/thumbnails/auto/IMG_8199.jpg?size=l&access_token={mytoken}. So I'm wondering if there is a replacement for v2 with a similar URL like the one from https://api-content.dropbox.com/1/thumbnails/auto/IMG_8199.jpg?size=l&access_token={mytoken}.
Thanks, - Greg-DB10 years ago
Dropbox Community Moderator
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!