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
- neunygph10 years agoExplorer | Level 4Oh I see, thanks Greg for helping me to know more about the v2 API.
Phuong - neunygph10 years agoExplorer | Level 4Hi 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-DB10 years ago
Dropbox Community Moderator
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.) - neunygph10 years agoExplorer | Level 4Oh ok, thank you very much.
Phuong - neunygph10 years agoExplorer | Level 4Hi 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-DB10 years ago
Dropbox Community Moderator
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
- neunygph10 years agoExplorer | Level 4Hi 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-DB10 years ago
Dropbox Community Moderator
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. - neunygph10 years agoExplorer | Level 4I 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, - Greg-DB10 years ago
Dropbox Community Moderator
The Content-Type header is reported differently (image/ in v1, and application/octet-stream in v2) but the actual thumbnail data returned is the same. Is the Content-Type header itself causing issues in your use case? I'll be happy to pass this along as feedback, but additional context would be helpful
Anyway, no, there isn't another way for getting temporary links or thumbnails like you describe that I can offer.
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!