I’m planning to migrate my custom apps to fdk 9.0.5 and facing some issues while doing so.
While trying to substitute iparam values to my request methods, I’m getting error: “error while substituting templates.”. And if I pass hardcoded values, it works. I’m passing fdurl and api_key from custom config page. Please help.
Sample code:
requests.json
{
"setFDConfig": {
"schema": {
"method": "GET",
"host": "<%= iparam.fdurl %>",
"path": "/api/v2/ticket_fields",
"headers": {
"Authorization": "Basic <%= encode(iparam.api_key) %>"
}
},
"options": {
"isOAuth": true
}
}
}
inside iparams.js
function apiCall() {
return client.request.invokeTemplate("setFDConfig", {})
}
inside iparams.html
<input class="fdinput" type="text" id="fdurl" placeholder="domain.freshdesk.com" />
</div>
<div>
<input class="fdinput" type="password" id="api_key" placeholder="API Key" />
</div>