Freshdesk onAppInstall,onScheduled events missing account_id from payload

Hi,

I’m migrating one of my apps from Platform version 2.3 to 3.0 (Global Apps).

I’m using account_id for sending emails via api .

I’m using the app set up event onAppinstall and onSceduledEvent payload to get account id
It is missing the account_id property in the payload.

Below is the actual payload received while executing it in a custom app.

oAppInstallHandler invoked with following payload:

{

iparams: {},

timestamp: 1771052770,

region: ‘IND’,

currentHost: {

subscribed_modules: [ ‘support_ticket’ ],

endpoint_urls: { freshdesk: ‘https://………….com’ },

product_types: { freshdesk: ‘DEFAULT’ } },

event: ‘onAppInstall’,

app_settings: {},

workflow: ‘install’

}

onScheduledEventHandler invoked with following payload:

{
timestamp: 1496400354326,
event: ‘onScheduledEvent’,
region: ‘IND’,
data: {
sample_data1: ‘sample value1’,
sample_data2: ‘sample value2’,
sample_data3: 3
},
iparams: {},
currentHost: {
endpoint_urls: { freshdesk: ‘https://………com/’ },
subscribed_modules: [ ‘support_ticket’ ],
product_types: { freshdesk: ‘DEFAULT’ }
},
app_settings: {}
}

Is there any other ways to get account_id from payload?

Hi @saranya_poovendiran,

Regarding the missing account_id in the onAppInstall and onScheduledEvent payloads, this is an intentional change in Platform version 3.0.

  • Reason for change: The account_id field was removed because the new Global Apps architecture is designed to be product-agnostic through the use of modules.
  • Action required: You should update your app logic to rely on the currentHost object found in the new payload structure.
  • Alternative: The currentHost object provides relevant context, such as endpoint_urls (domain names) and org_domain, which replaces the reliance on a specific account ID for many use cases.

Please refer to the “App code changes” section of the Migration Guide for a comparison of the 2.3 and 3.0 payload schemas, and instructions for implementing currentHost.