Hi team,
I have been trying to figure out what the problem here is but I am unable to. Would be great if someone can help here.
I am trying to make a request from the installation page but I get this error.
“Uncaught TypeError: client.request.invokeTemplate is not a function” (attached screenshot)
I am trying to invoke the request this way :
client.request.invokeTemplate("getContactFields", {})
.then(function(data) {
fields = JSON.parse(data.response).fields;
}, function(error) {
//do something
});
I have declared the function in requests.json in the config folder:
"getContactFields" : {
"schema": {
"method": "GET",
"host": "kkindiatest.myfreshworks.com",
"path": "/crm/sales/api/settings/contacts/fields",
"headers": {
"Authorization": "Token token=<%= iparam.api_key %>",
"Content-Type": "application/json"
}
}
I have declared this request in the manifest.json file as well.
"requests": {
"getContactFields": {}
}