Is there curl command or API call to retrieve image from ton.twitter.com URL?

image
api

#1

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:
https://ton.twitter.com/i/ton/data/dm/715234268641775621/715234268721520640/-qWnsSxZ.jpg

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?


#2

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:


#3

Thanks!


#4