This was how the app was making a request on platform 2.2
function getFreshchatChannels() {
let freshchatUri = FRESHCHAT_URL + "/v2/channels?items_per_page=100";
console.info('freshchatUri: ', freshchatUri);
let header = {
"Authorization": "Bearer " + TOKEN,
"Accept": "application/json",
"Content-Type": "application/json"
};
let options = {
headers: header,
maxAttempts: 5,
};
client.request.get(freshchatUri, options)
.then(function(data) {
console.info('Channels data: ', data);
if(data.status === 200) {
const response = JSON.parse(data.response);
console.info('Channels response: ', response);
const channels = response.channels;
console.info('Channels: ', channels);
if(Array.isArray(channels)) {
channels.forEach(function(channel) {
if(channel.id && channel.name) {
channelId2NameMap.set(channel.id, channel.name);
}
})
}
console.info('channelId2NameMap: ', channelId2NameMap);
getFreshchatGroups();
} else {
freshChat.showNotify('error', 'Unable to retrieve channels information from Freshchat.');
return null;
}
}, function (error) {
console.error('Error received Freshchat channels data: ', error);
})
}
Making requests on platform 2.3 using a request template.
function getFreshchatChannels() {
let freshchatUri = FRESHCHAT_URL + "/v2/channels?items_per_page=100";
console.info('freshchatUri: ', freshchatUri);
// Updated Request: invoking Template
client.request.invokeTemplate("getFreshchatChannels", {
context: {
path: FRESHCHAT_URL,
TOKEN: TOKEN
},
})
.then(function(data) {
console.info('Channels data: ', data);
if(data.status === 200) {
const response = JSON.parse(data.response);
console.info('Channels response: ', response);
const channels = response.channels;
console.info('Channels: ', channels);
if(Array.isArray(channels)) {
channels.forEach(function(channel) {
if(channel.id && channel.name) {
channelId2NameMap.set(channel.id, channel.name);
}
})
}
console.info('channelId2NameMap: ', channelId2NameMap);
getFreshchatGroups();
} else {
freshChat.showNotify('error', 'Unable to retrieve channels information from Freshchat.');
return null;
}
}, function (error) {
console.error('Error received Freshchat channels data: ', error);
})
}
request.json
"getFreshchatChannels": {
"schema": {
"method": "GET",
"protocol": "https",
"host": "<%=iparam.subdomain %>.freshchat.com",
"path": "<%= context.path %>",
"headers": {
"Authorization": "Bearer <%= context.TOKEN %>",
"Accept": "application/json",
"Content-Type": "application/json"
}
},
"options": {
"maxAttempts": 5
}
},
manifest.json
"requests": {
"getRelatedCase": {},
"getFreshchatChannels": {},
"getFreshchatGroups": {},
"Freshchat": {},
"FreshchatPost": {},
"InstanceURL": {},
"getCaseforChangeOwner": {},
"getCaseRecordType": {},
"findSalesforceCase": {},
"getLiveChatButtonId": {},
"getLiveChatDeployment": {},
"createLiveChatVisitor": {},
"getUser": {},
"getInstanceUrl": {}
}```
Getting Error:

app.js:1902 Error received Freshchat channels data:
{headers: {…}, errorSource: 'APP', response: 'Request template not found', status: 404}
errorSource
:
"APP"
headers
:
[[Prototype]]
:
Object
response
:
"Request template not found"
status
:
404