Hi, I’m creating this app for FreshCaller to find ticket created after call to be tagged with assigned call queue. But I keep getting ‘error while substituting templates’ error.
{
"tagTickets": {
"schema": {
"protocol": "https",
"method": "PUT",
"host": "travelbuggy.freshdesk.com",
"path": "/api/v2/tickets/<%= server.TicketID %>",
"headers": {
"Authorization": "Bearer <%= iparam.freshdesk_api_key %>",
"Content-Type": "application/json"
},
"query": {
}
},
"options": {
"retryDelay": 1000
}
}
}
{
"platform-version": "2.3",
"product": {
"freshcaller": {
"events": {
"onCallCreate": {
"handler": "onCallCreateCallback"
},
"onCallUpdate": {
"handler": "onCallUpdateCallback"
}
},
"requests": {
"tagTickets": {},
"getTickets":{}
}
}
},
"engines": {
"node": "18.17.1",
"fdk": "9.0.4"
}
}
if (CallDirection == "incoming") {
if (TicketID) {
$request.invokeTemplate("tagTickets", {
body: JSON.stringify(contents),
})
.then(function (data) {
console.log(data);
},
function (error) {
console.log(error);
});
}
}