Use data method

Data method is an interface that the developer platform provides to enable your app to retrieve product data (in the form of JSON payloads).

When an app is initialized successfully, the parent app (Freshworks product) passes a client reference to your app. Your app can use this reference and the developer platform’s data method to retrieve the different objects on the Freshworks product UI, as payloads.

To enable your app to retrieve product data, in the app.js file,

  1. Subscribe to the app.initialized event, through an event listener. When the app is initialized, the parent application passes a client reference to the app.
  2. After app initialization, use the data method - client.data.get(<objectName>) - to retrieve the specified object (<objectName>) from the product UI.

As part of the app logic, your app can process the retrieved payload to derive meaningful results.

This section,

  • Lists all the objects that can be retrieved by using the data method.
  • Describes all the attributes of the retrieved object.

Data objects accessible from all pages

These objects are available in all pages of the product UI. Irrespective of the page on which the app is deployed, when you use the data method -client.data.get(<objectName>)- and retrieve these objects, the corresponding payload is retrieved.

An app can retrieve the following objects irrespective of where the app is deployed:

currentHost

  • subscribed_modulesarray of strings

    All modules that the app user has subscribed to and present in the app manifest.

  • endpoint_urlsobject

    Product name and account url (domain name) to access product resources, specified as a key (product name) - value (account URL) pair.

    You can use the domain name to construct api calls that can access product resources.

  • org_domainstring

    Organization domain is the domain value in the organization URL. This organization domain is created when you first sign up for a Freshworks product and is tied to all your accounts across different Freshworks products. You can use this value to pre-populate the organization domain value during app installation.

  • itam_versionobject

    Information pertaining to the product where the app is currently running. When you select ITSM, you can further select a variant of the product: BASIC or ADVANCED.

    • freshservicestring

      Name of the variant of the product.

      Possible values:

      • BASIC: For Freshservice account sign-ups prior to 31st March, 2026,.
      • ADVANCED: For Freshservice account sign-ups that happened after 31st March, 2026,. This account leverages extended asset discovery powered by Device 42.
  • workspacesobject

    Information pertaining to the workspace for which the app is installed. When you specify installation scope in your app manifest, this attribute will be retrieved as a part of the currentHost object in the payload.
    To learn more about the workspace or client level installation, see Configure app installation scope.

    • freshserviceobject

      Information pertaining to the product for which the workspace is available.

      • idinteger

        Identifier of the workspace or client for which the app is installed.

        Note:This attribute is returned as a part of the currentHost payload at runtime and also in product events, external events, scheduled events, app setup events, and SMI payloads.

loggedInUser

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the agent logged into the Freshservice.

Attributes of the loggedInUser object

  • availableboolean

    If the agent is in a group that has enabled Automatic Ticket Assignment, this attribute will be set to 'true' if the agent is accepting new tickets.

  • created_atstring

    Contact creation timestamp.

  • group_idsarray of strings

    Group IDs associated with the agent.

  • idinteger

    User ID of the agent.

  • occasionalboolean

    Specifies whether the agent is an occasional agent or a full-time agent .

    Possible values: true, false

  • signaturestring

    Signature of the agent in HTML format.

  • updated_atstring

    Agent updated timestamp.