How to use API in FreshDesk App

We are trying to create one custom fresh desk app. We have already gone through the first sample app successfully but now we are not able to proceed further. So we are sharing our requirements below. So please help us to proceed.
We want to create a custom app where app will call a API URL with customer id. The API will return some data based on this id and we need to display this in this app.
Please let us know how should we proceed.

It will be helpful if you can elaborate a bit about where you are facing an issue. Are you facing issues calling API Url in the frontend app? If so, you can look at Request Method and Freshdesk documentation.

Please see the below code of app.js file. We are trying to implement it but our localhost url is not called. Please help us.

document.onreadystatechange = function () {
  if (document.readyState === 'interactive') renderApp();

  function renderApp() {
    var onInit = app.initialized();


    function getClient(_client) {
      window.client = _client;'app.activated', onAppActivate);

function onAppActivate() {
  var textElement = document.getElementById('apptext');

  var getContact = client.request.get("http://localhost/index.php?route=account/test", { client: true });


  function showContact(payload) {
    textElement.innerHTML = `Ticket created by ${}`;

function handleErr(err) {
  console.error(`Error occured. Details:`, err);


Hi @opencartcity,

I suspect that there might be validation issues with regards to the use of localhost URL. Request method expects a FQDN and would throw an error if its a localhost URL / IP. Can you start an ngrok server that acts as an alias for the localhost URL ?

var getContact = client.request.get("", {
    client: true
getContact.then(function(data) {
}).catch(function(err) {
1 Like

Thanks for your response and it worked but we are not able to send and receive the data now. So we basically want to send the customer id based on ticket id and receive some data based on this id.
In detail, we want to achieve the work flow where we open a ticket, it calls a url with customer id of this ticket, we get the response from this url and display in app.

Is there any one who can help with this?

@opencartcity Please find the sample app here to create a ticket with the Request Method on our platform - GitHub - freshworks-developers/say-hello: An 'Hello World' app for anyone who is planning to build apps on Freshworks developer platform.

Data methods can be used to get some data from the existing page - Freshworks Developer Docs | Use data method

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.