Hello,
I am trying to get tickets from Freshdesk using the new fdk 9.0.0 request templates. I am receiving the error “error while substituting templates.” I have followed all of the documentation here and here.
Request.json file
{
"getFreshdeskOpenTickets": {
"schema": {
"method": "GET",
"host": "ipostal1.freshdesk.com",
"path": "/api/v2/tickets",
"headers": {
"Authorization": "Basic <%= encode(iparam.apikey) %>",
"Content-Type": "application/json"
},
"query": {
"email": "<%= context.email %>"
}
}
}
}
Manifest.json
{
"platform-version": "2.3",
"product": {
"freshdesk": {
"location": {
"ticket_sidebar": {
"url": "index.html",
"icon": "styles/images/icon.svg"
}
},
"requests": {
"getFreshdeskOpenTickets": {}
}
}
},
"engines": {
"node": "18.14.2",
"fdk": "9.0.0"
}
}
app.js – invoke template
const contactData = await client.data.get('contact');
const { contact: { email } } = contactData;
const response = await client.request.invokeTemplate("getFreshdeskOpenTickets", {
context: {"email": email}
// body: JSON.stringify(body)
})