Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

Mesqueeb's avatar
Mesqueeb
Helpful | Level 6
9 years ago

How to display images (get their links) without making two API calls? (Javascript API)

So I currently have a set up to display images on a webpage:

 

dbx.filesListFolder({path: ""})
	.then(function(response) {
		response.entries.forEach( (file) => {
			dbx.filesGetThumbnail({path: file.path_display, size: 'w1024h768'})
			// And here I wrote the code that creates <img> to display them on my page.

However, this makes my client make two API calls, which is a heavy payload. Is there a way to combine `dbx.filesListFolder` and `dbx.filesGetThumbnail` into 1 API call?

 

Cheers!

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    No, unfortunately there isn't a way to get thumbnails along with the listing at the same time. I'll pass it along as a feature request.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,038 PostsLatest Activity: 6 years ago
415 Following

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 or Facebook.

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!