Hi Gokul,
Thank you very much for the follow-up.
What I’m trying to do is not using sharepoint API but using the download.aspx of sharepoint to download the file.
https://.sharepoint.com/sites//_layouts/download.aspx?SourceUrl=
I don’t think this would needs API key. It only needs the authentication user name and password.