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,
- 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.
- 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
A global app, with module-specific app logic, can be deployed on various Freshworks products. currentHost refers to the Freshworks product on which the app is currently running. Based on the currentHost, from the back-end, we retrieve the modules that the app user working on the currentHost has subscribed to. Based on the subscribed modules, we can retrieve the product-specific urls that the app built for the modules can use, to access the product resources. The organization domain associated with the account can also be retrieved, which can be pre-populated during the app installation using utils.set(); method in the onFormLoad() callback function definition. For information on the onFormLoad() function, see Make your installation page dynamic.
For more information on currentHost, see Global app concepts.
Use the sample code shown on the right pane > Sample code tab, to retrieve the currentHost object that contains information on,
- All modules that the app user using the currentHost has access to and applicable to the app.
- All product names and the corresponding account urls through which the app built for the subscribed modules can access product resources.
Attributes of the currentHost object
- subscribed_modulesarray of stringsAll modules that the app user has subscribed to and present in the app manifest. 
- endpoint_urlsobjectProduct 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_domainstringOrganization 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. 
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
- availablebooleanIf 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_atstringContact creation timestamp. 
- group_idsarray of stringsGroup IDs associated with the agent. 
- idintegerUser ID of the agent. 
- occasionalbooleanSpecifies whether the agent is an occasional agent or a full-time agent . Possible values: true, false 
- signaturestringSignature of the agent in HTML format. 
- updated_atstringAgent updated timestamp. 
Asset details page
An app deployed on the Asset details page can use the client.data.get(<objectName>) data method and retrieve the following object:
asset
Use the sample code shown on the right pane > Sample code tab, to retrieve information of the asset.
Attributes of the asset object
- agent_idintegerID of the associated agent (managed by). 
- agent_namestringName of the associated agent (managed by). 
- asset_tagstringAsset tag of the asset. 
- assigned_onstringDate at which the asset is assigned. 
- business_impactstringName of the impact. Possible values: 1: Low 2: Medium 3: High 
- ci_type_idintegerID of the asset type. 
- ci_type_namestringName of the asset type. 
- department_idintegerID of the associated department. 
- department_namestringName of the associated department. 
- descriptionstringDescription of the asset. 
- display_idintegerDisplay ID of the asset. 
- group_idintegerID of the associated agent group (managed by group). 
- impactintegerID of the impact. 
- idintegerID of the asset. 
- location_idintegerID of the associated location. 
- location_namestringName of the location associated to the asset. 
- namestringName of the asset. 
- product_namestringName of the product associated to the asset. 
- state_namestringName of the state associated to the asset. 
- usage_typeintegerUsage type of the asset. Possible values: 1: Permanent 2: Loaner 
- used_bystringName of the associated user (used by). 
- user_idintegerID of the associated user (used by). 
- vendor_namestringName of the vendor associated to the asset.