Issue in API request - Error while substituting the templates

Hello!

I am facing the issue 400 “Error while substituting the templates” .

The above error occurs at frontend APP. When I am about call(GET) the conversation of the ticket and agent details through Request API, I am getting the above error. It was working fine before but right now the API request is not working in the frontend APP.

  1. It works on my local environment , In fact i hit multiple times my validation process after and before the installation it works perfectly.
  2. After complete testing of the APP in Local environment, I have deployed the APP in production where the API request is not working and throughs error message like 400 “Error while substituting the templates”.

MY TRIES
I have visited the community for the solution. Unfortunately not able fix the issue.

SAMPLE CODE
//Get Agent Details
function getAgent()
{
var headers1={ “Authorization”: “Basic <%= encode(iparam.api_key) %>”,
‘Content-Type’: ‘application/json’
};
var options={
‘headers’:headers1
};
var url=https://${window.azure_domain}/api/v2/agents/me;

			client.request.get(url,options)
				.then (function(body) {
						if(body)
						{	
							console.log("Agent...body response",body);							
						}
						
					}).catch(err=>{     					  
					  console.error(err); 					
					})  
              }

DEBUG LOG

image

Thanks!

@Priya_Dharshini,
Good Day!
As per the security update we restricted making API calls if it is not whitelisted, have whitelisted your API in Manifest.json?

Hi Santhosh!

Thanks for the response!

We have already whitelisted the domain name. But still facing the same issue.

Hi @Priya_Dharshini,

I had a chance to connect with my team on this. This apps seems to have effected by a security update where the platform is letting Request Calls fail from the Configuration page.

I have requested some app-related details on the private message that I’ve initiated on the forum inbox.

1 Like

Thanks for the support Saif!