Is there curl command or API call to retrieve image from URL?



I am building an integration to get images from direct messages. However, although I am able to get the media_url_https via the API, I can’t open the media link programmatically via curl.

This is the sample URL I am using to test:

I am able to open it in the browser but not via curl. Is there some curl header parameters or a twurl call that I can get image hosted on Twitter Object Nest downloaded programmatically?


Hi @lchan_zen, the images in DMs are protected by authentication. You will need to request the image with an auth token. Check out this post for more information:



closed #4