Twitter Direct Message GIF media issue

directmessages
api

#1

GIF shared in direct message, returns media_url “https://pbs.twimg.com/dm_gif_preview/755386489547071488/7APz9ouovsA_x1IpSe4Dx-J8uVraS7EfifxhjtBYXkcVF3T9nh.jpg” which is publicly available, but when any image is shared the media_url “https://ton.twitter.com/1.1/ton/data/dm/755282280747192323/755282280780750848/P8oYOFtP.png” not accessible publicly and need authentication. So the fetching gif doesn’t work seamlessly for like jpg/png. Please help us how to retrieve gif image other then getting the media file stream.

Thanks in advance