Thank you for providing the console log. The error message with a status code of 400 and the response “error while substituting templates” indicates that there might be an issue with the template rendering or substitution when making an API request.
Please review the following points to troubleshoot this issue:
Ensure that your server.js file has the correct implementation of handling $request.invokeTemplate() and the required callback for the function call.
Verify that the template syntax for your server.js app.set('views', './server/views', 'ejs'); is correct, and placeholders in the request schema are properly defined and implemented.
Make sure that you are passing the correct context to invokeTemplate. Double-check the key names and variable values to ensure they match your request schema.
Additionally, check your Freshdesk API Key, ensure it is set up correctly in your code, and is passed correctly to the template.
If you are still facing issues after verifying these points, please consider sharing a minimal code sample or repository demonstrating the issue. This would allow us to provide more specific guidance on resolving the error.
Based on the details provided, it seems like the error might be tied to the usage of Vue.js in your project. Here are some steps to troubleshoot this issue:
Examine the initialization process of Freshdesk API in your Vue.js app. Make sure the setup is properly configured for Freshworks SDK in the Vue.js app.
Revisit your Vue.js app’s import and configuration settings to ensure that all necessary dependencies and configurations are applied correctly.
Consider creating a minimal test implementation of Freshworks SDK using Vue.js to identify and isolate the issue in a simplified environment.
As a temporary workaround, you might want to create a separate method within server.js to handle the API request. Once the response is retrieved, you can send the data to your client-side Vue.js app. This approach could help you mitigate the issue caused by invoking templates from the Vue.js client-side.
If you could share any additional logs, code snippets, or a repository that reproduces the problem, it would be easier for us to provide more specific guidance on fixing the issue.
We have identified the exact reason for the issue. The problem lies in the schema requests.json file. When we hardcoded the domain, the app worked fine. However, when we tried to pass the domain via context, we encountered a substituting template error message.
Hi Glen,
Hope you are doing well and We apologize for the delay in providing you with an update.
We have made significant progress with the Freshdesk technical team, with 98% of the upgrading processes completed. However, we are currently facing an issue with passing the domain name to the API dynamically.
The Freshworks support team suggested setting the domain name in the Installation configuration page, but since we have multiple domains in our Production environment, we need to find a way to pass the domain name dynamically to the API. We have also raised a ticket in the Freshworks community and are actively following up with them for a resolution.
Despite this challenge, all other necessary changes have been completed. We are optimistic that we will resolve this issue before your return. Thank you for your understanding.