Skip to main content
Question

List of agents via the API

  • January 19, 2026
  • 0 replies
  • 0 views

Andrusi4ka
Apprentice

Hello everyone! I’m new here and just getting started with development in Freshworks. Right now, I’m trying to create my first app. I’m attempting to get a list of agents via the API, but something is going wrong. I’m getting a console error about an unregistered function. Even though I’m doing everything according to the documentation. If anyone knows what might be the issue, please let me know.

 

manifest.json

{
"platform-version": "3.0",
"modules": {
"common": {
"location": {
"full_page_app": {
"url": "index.html",
"icon": "styles/images/icon.svg"
}
},
"requests": {
"getAgents": {}
}
},
"support_ticket": {}
},
"engines": {
"node": "18.20.8",
"fdk": "9.7.4"
},
"app": {
"tracking_id": "aixfa4rlutw791e3iubp"
}
}

requests.json

{
"getAgents": {
"schema": {
"protocol": "https",
"method": "GET",
"host": "<%= iparam.domain %>.freshdesk.com",
"path": "/api/v2/agents",
"headers": {
"Authorization": "Basic <%= encode(iparam.api_key) %>",
"Content-Type": "application/json"
}
}
}
}

app.js

let client;

init();

async function init() {
client = await app.initialized();
client.events.on('app.activated', loadAgents);
}

async function loadAgents() {
try {
const response = await client.request.invoke("getAgents", {});

const agents = JSON.parse(response.response);
console.log('Agents:', agents);
} catch (error) {
console.error('Error loading agents:', error);
}
}