Analytics SDK getOauth api is failing only in production

Analytics SDK getOauth api is failing only in production

I am using ZohoAnalytics SDK and with it I am sycing data to Zoho analytics workspace. Things are working perfectly in local environment but when I pushed code in production (AWS ECS), getOauth function in SDK is failing. 

The reason for failure is, when the function requests on the api it gets HTML in response and it tries to parse the response with JSON.parse().

The HTML content received consists

“An error occured.
An error occured while processing your request.”

this content.

Is this an issue with Zoho server or from my end ?