I am trying to fetch data from Freshsales in freshdesk using the new fdk 9.0.0 request templates. I am receiving the error “error while substituting templates.
requests.json file:
app.js file :
Network devlopment object :
error message :
I am trying to fetch data from Freshsales in freshdesk using the new fdk 9.0.0 request templates. I am receiving the error “error while substituting templates.
requests.json file:
app.js file :
Network devlopment object :
error message :
Hi @Vrushali_Ambre,
The host
can only be sent dynamically through context from the Serverless app. In the frontend component, it cannot be sent dynamically. Please use iparams or some other way to use the host.
Also, first, try to test the API once with hard-coded values for all the attributes. After it works, change one by one to use dynamically with templates for iparams, context, and others.
Hi @Raviraj ,
I tried using hard coded values, but still it is not working. I think the issue is with the query param, as I have constructed the query params as part of the path itself.
@Vrushali_Ambre In that case, have you tested the endpoint once in a cURL or Postman? If so, you can almost mimic it by hard coding pretty much everything and see if it works.
Adding query param in the path will also work fine. If it’s still not working, please share the request schema with sensitive details hidden and we can try to help.
Hi @Raviraj ,
I have already tried postman and it is working in postman, but it is not working in request schema. Below is a screenshot where I have added a hard-coded value.
Hi @Vrushali_Ambre ,
Please check the request name, it should be similar name in InvokeTemplate, requests.json file and manifest.json file. In your case you used name like “getCrmContact” in invokeTemplate, but in requests.json file you used like “getCrmDetails”,but i could be the same name. So please make sure that the names must be similar while invokeTemplate, requests.json and manifest.json
Hi @Arun_08_03 ,
Request Name is same in both the file.
Everything I have checked and I am not sure where the issue is.
Hi @Vrushali_Ambre
And I found one more issue in your given screen shot, while invoking API call you are passing Authorization like Token token=${crmA}, but it should be ${crmA} because in headers you are using Token token=<%context.authorization %> ,you just need to pass the api key only
Example: app.js
client.request.invokeTemplate( "yourTemplateName", { context: { authorization: crmA } });
request.json
"headers": { "Authorization": "Token token=<%= context.authorization %>" }
Hi @Arun_08_03 ,
As you can see, even when I tried sending hardcoded values, I still received an error message. Additionally, the authorization method you suggested is not working
Hi @Vrushali_Ambre ,
What I shared earlier is correct. Also, please ensure that the host
is set to domain.freshservice.com
. Since you’re working with Freshsales CRM, the path should start with crm/sales/api/lookup?query=...
. Try configuring it this way. However, based on the error message, it’s likely that the issue lies within your schema—either the host
, path
, or apikey
might be incorrect or missing. Please double-check these values.
Hi @Arun_08_03 ,
Please check in the earlier screenshot attached where I have hard coded all values in which I have mentioned everything properly host and path start with /crm/ but still it is not working.