Please better formulate your questions - How to authenticate? Is really not enough.
Are you able to login with this user and render the particular template in studio?
Is it admin user or a custom user created in studio?
If it is only problem of your client API call, can you try to use request package and post here full code?
Maybe you could also try to use markdown formatting to highlight code
https://help.github.com/articles/creating-and-highlighting-code-blocks/
Thank you