File url endpoint is returning HTML instead of File

Hello.

I was trying to download a file using python with requests library in a url endpoint like
https://domain.com/jiraserver/secure/attachment/{file id}/{file name}, but it is returning to me a HTML instead of a File.

I already used the curl tool in linux, but is the same.

Note: I’m using Bearer token on headers too.

Can anyone help me?