Angular Jira REST API Error: SyntaxError: Unexpected token '<', "<!doctype "... is not valid JSON

Hello Atlassian Developer Community,

I hope this message finds you well. I am currently facing an issue with my Angular application that integrates with the Jira REST API. The integration works flawlessly on localhost, but when deployed to development and production environments, I encounter the following error: `SyntaxError: Unexpected token ‘<’, "<!doctype “… is not valid JSON.” The network response indicates that an HTML document is being received instead of the expected JSON.

Here are some key details about my setup:

  1. I’m using basic authentication with my email and the Jira token.
  2. In my headers, I include the following:
'Content-Type': 'application/json',
Accept: 'application/json,*/*;q=0.9',
  1. I’m wondering if there might be specific configurations required on the Atlassian Developer portal or if OAuth 2.0 (3LO) needs to be implemented for this to work in a deployed environment.

I would greatly appreciate any insights or guidance from the community on resolving this issue. Has anyone encountered a similar problem, and if so, how did you address it? Are there specific configurations or steps I might be missing in the Atlassian settings?

Your assistance will be invaluable, and I’m eager to learn from your experiences. Thank you in advance for your time and support.

Best regards,