How to get webhook-style notifications when a new location is added

Hmm…

From what I understand,

  1. The Freshservice Account has Service Items with the ‘Location’ field on each service item.
  2. Now, from a different runtime (let’s assume out side Freshworks), the broker makes a create ticket API call to Freshservice. Of course, somehow you also get all the locations at one time.

The problem is your broker needs to have an updated list of these locations.

Here’s what you can maybe do:

You can build a custom app on the Freshworks platform that runs a corn job. We label it as scheduled events.

// register a recurring schedule maybe once a day onAppInstall

let scheduleDetails = {
        name: args.scheduleName,
        data: args.scheduleData,
        schedule_at: args.scheduleData.scheduleAtUTC
      };
      let scheduleCreationStatus = await $schedule.create(scheduleDetails);

exports = {
 onScheduledEventHandler: async function (payload) {
/*      
      1. Make getAllLocations API call
      2. Store the locations and send it to the broker. (The broker needs to open up an endpoint
          to receive the details.)
      3. Look if there are new updates to store in the broker. Every Day.
  }
}

You can learn from about building apps

  1. Introductory guide to Freshworks App Development
  2. Documentation: Scheduled Events
  3. Tutorials if you prefer to: Deep-dive into Serverless, Introduction to Freshworks Serverless Apps