How to load images using metadata from the DropBox API

风流意气都作罢 提交于 2019-12-12 04:43:25

问题


I am getting just getting started with the DropBox API. Using POSTMAN, I have successfully retrieved an access token and have been able to list the metadata for files in my dropbox. I am trying to figure out how to use that metadata to load images on a web page using javascript. Is there an http call to generate a valid url to be used as the src parameter for an image or video element?


回答1:


I think you're looking for the /media endpoint: https://www.dropbox.com/developers/core/docs#media. It generates anonymous-read URLs that work for up to four hours.

UPDATE

I'm not sure if you're using dropbox.js or not, but the method there is called makeUrl.




回答2:


Ah, I found it! The request name isn't the most intuitive, so I missed it looking through the documentation.

https://api.dropbox.com/1/media//



来源:https://stackoverflow.com/questions/22079407/how-to-load-images-using-metadata-from-the-dropbox-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!