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 (Freshservice) 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 Freshservice 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:

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.

domainName

Use the sample code shown on the right pane > Sample code tab, to retrieve the domain name of the business account that uses Freshservice and a product context that can be used in the app logic.

Attributes of the domainName object

  • domainNamestring

    Domain of the company. Email addresses of the contacts that contain this domain will be associated with that company automatically.

Ticket details page

An app deployed on the Ticket details page can use the client.data.get(<objectName>) data method and retrieve the following objects:

ticket

Use the sample code shown on the right pane > Sample code tab, to retrieve information of a ticket.

Attributes of the ticket object

  • idinteger

    Identifier of the ticket object, auto-generated when a ticket is created in the Freshworks system.

  • created_atstring

    Timestamp of when the ticket is created in the Freshworks system, specified in the UTC format.

  • updated_atstring

    Timestamp of when the ticket details are last updated in the Freshworks system, specified in the UTC format.

  • integerstring

    Identifier of the Freshservice account, auto-generated when the account is configured for an organization.

  • approval_statusinteger

    The user who created a service request ticket in the Freshservice system can request approval for the service item from another stakeholder. approval_status identifies the approval status of a service request ticket.

    Possible values:
    0: The user has requested approval for the service item.
    1: The stakeholder has approved the request.
    3: The approval granted previously for the request has been canceled.
    2: The stakeholder has rejected the request.
    4: The user has not requested approval for the service item.
    5: A team member delegated by the stakeholder has approved the request.

    For incident tickets created in the Freshservice system, the value of this attribute is null.

  • approval_status_namestring

    Approval status of the ticket associated with a service request.

    Possible values: Requested, Approved, Rejected, Not requested

  • assoc_asset_idinteger

    Multiple assets can be associated with a ticket. assoc_asset_id is the identifier of the asset that was first associated with the ticket.

  • assoc_change_cause_idinteger

    Attribute to be deprecated soon.

    An incident ticket created in the Freshservice system can have multiple changes associated with it. assoc_change_cause_id identifies the change that initiated the ticket.

    For service request tickets created in the Freshservice system, the value of this attribute is null.

  • assoc_change_causes_idsarray of integers

    Identifiers of all changes that initiated the ticket, specified as an array.

  • assoc_change_idinteger

    Attribute to be deprecated soon.

    An incident ticket created in the Freshservice system can have multiple changes associated with it. assoc_change_id identifies the change initiated due to the ticket.

    For service request tickets created in the Freshservice system, the value of this attribute is null.

  • assoc_changes_idsarray of integers

    Identifiers of all changes initiated due to the ticket, specified as an array.

  • assoc_problem_idinteger

    Identifier of the problem associated with the ticket.

  • categorystring

    Category to which the ticket created is associated.

    Tickets can be associated with different categories in Freshservice, which helps classify, track, and prioritize tickets.

  • cc_emailobject

    Details of the email addresses associated with the ticket.

  • custom_fieldobject

    To obtain additional ticket information, custom fields could be configured in the Freshworks system.

    The custom_field attribute contains the custom field names and corresponding values, as a valid JSON object of key (custom field name)-value (custom field’s value) pairs.

  • deletedboolean

    Specifies whether the ticket is deleted from the Freshworks system.

    Possible values: true, false

  • department_id_valueinteger

    Identifier of the department to which the ticket created is associated.

  • department_namestring

    Name of the department to which the ticket created is associated.

  • descriptionstring

    Summary of the issue raised in the ticket, in plain text format.

  • description_htmlstring

    Summary of the issue raised in the ticket, in HTML format.

  • display_idinteger

    Identifier of the display preferences set for the ticket fields.

  • due_bystring

    Timestamp indicating when the ticket is due to be resolved, specified in the UTC format.

  • email_config_idstring

    Identifier of the customized email address, which is configured to automatically create a new ticket from the email received to the support email.

  • fr_escalatedboolean

    Specifies whether the ticket has been escalated for delay in sending the first response.

    Possible values: true, false

  • frDueBystring

    Timestamp indicating when the first response is due for the ticket, specified in the UTC format.

  • group_idstring

    Identifier of the group associated with the ticket.

  • impactinteger

    Identifier of the group associated with the ticket.

    An agent who creates a ticket in the Freshservice system can assign an impact status to the ticket created. impact identifies the impact assigned to the ticket.

    Possible values:
    1: Low impact
    2: Medium impact
    3: High impact

  • impact_namestring

    Impact assigned to the ticket by an agent.

    Possible values: Low, Medium, High

  • import_idstring

    Tickets can be imported into the Freshservice system. The import_id attribute is the identifier of the ticket in the source instance.

  • isescalatedboolean

    Specifies whether the ticket has been escalated for any reason.

    Possible values: true, false,

  • item_categorystring

    Category item associated with the ticket.

  • owner_idinteger

    Identifier of the agent to whom the ticket is assigned.

  • priorityinteger

    Identifies the priority assigned to the ticket.

    Possible values:
    1: Low priority
    2: Medium priority
    3: High priority
    4: Urgent priority

  • priority_namestring

    Priority assigned to the ticket.

    Possible values: Low, Medium, High, Urgent

  • requester_idinteger

    Identifier of the requester who created the ticket.

  • requester_namestring

    Name of the requester who created the ticket.

  • requester_status_namestring

    Status of the ticket displayed to the requester in the support portal.

  • responder_idstring

    Identifier of the agent to whom the ticket has been assigned.

  • responder_namestring

    Name of the agent to whom the ticket has been assigned.

  • sourceinteger

    Identifier of the channel through which the ticket was created. The default channels and the corresponding values are,

    1: Email
    2: Portal
    3: Phone
    4: Chat
    5: Feedback Widget
    6: Yammer
    7: AWS CloudWatch
    8: Pagerduty
    9: Walk-up
    10: Slack

    In addition to the default sources defined, new channels can be added.

  • source_namestring

    Channel through which the ticket was created.

  • spamboolean

    Specifies whether the ticket has been marked as spam.

    Possible values: true, false

  • statusinteger

    Status of the ticket in the Freshservice system.

    Possible values:
    2: Open
    3: Pending
    4: Resolved
    5: Closed

  • status_namestring

    Status of the ticket.

  • sub_categorystring

    Sub-category associated with the ticket.

  • subjectstring

    Subject of the ticket created in the Freshworks system.

  • tagsarray of strings

    Keywords associated with the ticket, specified as an array.

  • ticket_typestring

    Type of issue the ticket is addressing.

    For more information, see what is a ticket type.

    Possible values: Incident, Service Request, Major Incident, Case, Query, Issue, Request, Alert

  • urgencyinteger

    Identifier of the urgency assigned to the ticket.

    Possible values:
    1: Low
    2: Medium
    3: High

  • urgency_namestring

    Urgency assigned to the ticket.

requester

Use the sample code shown on the right pane > Sample code tab, to retrieve information of a requester/contact.

Attributes of the requester object

  • activeboolean

    Set to 'true' if the user has been verified.

  • addressstring

    Address of the user.

  • created_atstring

    User creation timestamp.

  • custom_fieldobject

    Key value pairs containing the names and values of the custom fields.

  • deletedboolean

    Set to 'true' if the user has been deleted.

  • descriptionstring

    A short description of the user.

  • emailstring

    Primary email address of the user. If you want to associate additional email(s) with this user, use the other_emails attribute.

  • external_idinteger

    ID of the user in an external system.

  • helpdesk_agentboolean

    Set to 'true' if the user is an agent.

  • idinteger

    ID of the user.

  • job_titlestring

    Job title of the user.

  • languagestring

    Language of the user.

  • mobileinteger

    Mobile number of the user.

  • namestring

    Name of the user.

  • phoneinteger

    Telephone number of the user.

  • time_zonestring

    Time zone in which the user resides.

  • updated_atstring

    User updated timestamp.

agent

Use the sample code shown on the right pane > Sample code tab, to retrieve information of an agent.

Attributes of the agent object

  • activeboolean

    Set to 'true' if the user has been verified.

  • addressstring

    Address of the user.

  • created_atstring

    User creation timestamp.

  • deletedboolean

    Set to 'true' if the user has been deleted.

  • descriptionstring

    A short description of the user.

  • emailstring

    Primary email address of the user.

    If you want to associate additional email(s) with this user, use the other_emails attribute.

  • external_idinteger

    ID of the user in an external system.

  • helpdesk_agentboolean

    Set to 'true' if the user is an agent.

  • idinteger

    ID of the user.

  • job_titlestring

    Job title of the user.

  • languagestring

    Language of the user.

  • mobileinteger

    Mobile number of the user.

  • namestring

    Name of the user.

  • phoneinteger

    Telephone number of the user.

  • time_zonestring

    Time zone in which the user resides.

  • updated_atstring

    User updated timestamp.

department

Use the sample code shown on the right pane > Sample code tab, to retrieve information of the department.

Attributes of the department object

  • created_atstring

    Department created timestamp.

  • custom_fieldobject

    Key value pairs containing names and values of custom fields.

  • descriptionstring

    A short description of the department.

  • idinteger

    ID of the department.

  • namestring

    Name of the department.

  • updated_atstring

    Department updated timestamp.

group

Use the sample code shown on the right pane > Sample code tab, to retrieve information of the group.

Attributes of the group object

  • agent_idsarray of integers

    Array of agent IDs separated by commas.

  • idinteger

    ID of the group.

  • namestring

    Name of the group.

associatedProblem

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the problem associated with the group.

Attributes of the associatedProblem object

  • categorystring

    Problem category.

  • created_atstring

    Problem creation timestamp.

  • due_bystring

    Timestamp indicating when the problem is due to be resolved.

  • group_idinteger

    ID of the group to which the problem is assigned.

  • idinteger

    ID of the problem.

  • impactinteger

    Impact of the problem.

  • item_categorystring

    Item category of the problem.

  • known_errorboolean

    Set to 'true' if the problem is a known error.

  • owner_idinteger

    ID of the agent to whom the problem is assigned.

  • priorityinteger

    Priority of the problem.

  • requester_idinteger

    User ID of the requester.

  • statusinteger

    Status of the problem.

  • sub_categorystring

    Sub-category of the problem.

  • subjectstring

    Subject of the problem.

  • updated_atstring

    Problem updated timestamp.

associatedChanges

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the change associated with the group.

Attributes of the associatedChanges object

  • idinteger

    Identifier of the change initiated by the ticket.

  • created_atstring

    Timestamp of when the change is created in the Freshservice system, specified in the UTC format.

  • updated_atstring

    Timestamp of when the change details are last updated, specified in the UTC format.

  • approval_statusinteger

    The user who created a change in the Freshservice system can request approval for the change from another stakeholder. approval_status identifies the a pproval status of a change associated with the ticket.

    Possible values:
    0: The user has requested approval for the change.
    1: The stakeholder has approved the change.
    2: The stakeholder has rejected the change.
    3: The approval granted previously for the request has been canceled.
    4: The user has not requested approval for the change.
    5: A team member delegated by the stakeholder has approved the request.

  • categorystring

    Category to which the change associated with the ticket belongs.

  • change_typeinteger

    Type of change that was initiated by the ticket. change_type identifies the type of change associated with the ticket.

    Possible values:
    1: Minor change
    2: Standard change
    3: Major change
    4: Emergency

  • group_idinteger

    Identifier of the group to which the agent/requester associated with the ticket belongs.

  • impactinteger

    A change created in the Freshservice system can have an impact status assigned. impact identifies the impact assigned to the change associated with the ticket.

    Possible values:
    1: Low impact
    2: Medium impact
    3: High impact

  • item_categorystring

    Category item for the change associated with the ticket.

  • owner_idinteger

    Identifier of the agent to whom the change is assigned.

  • planned_start_datestring

    Proposed date and time for the assigned agent to initiate the change associated with the ticket.

  • planned_end_datestring

    Proposed date and time for the assigned agent to conclude the change associated with the change.

  • priorityinteger

    Identifier of the priority assigned to the change associated with the ticket.

    Possible values:
    1: Low priority
    2: Medium priority
    3: High priority
    4: Urgent

  • requester_idinteger

    Identifier of the requester who initiated the change request.

  • riskinteger

    Identifier of the risk value assigned to the change associated with the ticket.

    Possible values:
    1: Low risk
    2: Medium risk
    3: High risk
    4: Very High risk

  • statusinteger

    Identifies the status of the change associated with the ticket.

    Possible values:
    1: Open
    2: Planning
    3: Awaiting approval
    4: Pending release
    5: Pending review
    4: Closed

  • sub_categorystring

    Subcategory of the change associated with the ticket.

  • subjectstring

    Subject of the change associated with the ticket.

associatedTasks

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the task associated with the group.

Attributes of the associatedTasks object

  • closed_atstring

    Task closed at timestamp.

  • created_atstring

    Task creation timestamp.

  • deletedboolean

    Set to 'true' if the task is deleted.

  • descriptionstring

    Description of the task.

  • due_datestring

    Due date of the task.

  • group_idinteger

    ID of the group assigned to the task.

  • owner_idinteger

    User ID of the assigned agent.

recentChildTickets

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the recent child tickets.

Attributes of the recentChildTickets object

  • categorystring

    Ticket category.

  • cc_emailarray of strings

    Email address added in the 'cc' field of the incoming ticket email.

  • created_atstring

    Ticket creation timestamp.

  • deletedboolean

    Set as 'true' if the ticket is deleted/trashed. Deleted tickets will not be considered in any views except the "deleted" filter.

  • due_bystring

    Timestamp indicating when the ticket is due to be resolved.

  • frDuebystring

    Timestamp indicating when the first response is due.

  • group_idinteger

    ID of the group to which the ticket is assigned.

  • idinteger

    ID of the ticket.

  • isescalatedboolean

    Set to 'true' if an escalation was sent.

  • item_categorystring

    Item category of the ticket.

  • responder_idinteger

    ID of the agent to whom the ticket is assigned.

  • priorityinteger

    Priority of the ticket.

  • requester_idinteger

    User ID of the requester.

  • sourceinteger

    The channel through which the ticket was created.

  • statusinteger

    Status of the ticket.

  • sub_categorystring

    Sub-category of the ticket.

  • subjectstring

    Subject of the ticket.

  • ticket_typeinteger

    Type property field as defined in the parent ticket fields.

  • updated_atstring

    Ticket updated timestamp.

requesterAssets

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the assets associated with the requester.

ticketAssets

Use the sample code shown on the right pane > Sample code tab, to retrieve information on the assets associated with the tickets.

Attributes of the ticketAssets object

  • agent_idinteger

    ID of the associated agent.

  • created_atstring

    Asset creation timestamp.

  • idinteger

    ID of the item.

  • impactinteger

    Impact of the item.

  • namestring

    Name of the item.

  • updated_atstring

    Asset updated timestamp.

  • user_idinteger

    ID of the item user.

Contact details page

An app deployed on the Contact details page can use the client.data.get(<objectName>) data method and retrieve the following objects:

requester

Use the sample code shown on the right pane > Sample code tab, to retrieve information of a requester.

Attributes of the requester object

  • activeboolean

    Set to 'true' if the user has been verified.

  • addressstring

    Address of the user.

  • created_atstring

    User creation timestamp.

  • custom_fieldobject

    Key value pairs containing the names and values of the custom fields.

  • deletedboolean

    Set to 'true' if the user has been deleted.

  • descriptionstring

    A short description of the user.

  • emailstring

    Primary email address of the user.

  • external_idinteger

    ID of the user in an external system.

  • helpdesk_agentboolean

    Set to 'true' if the user is an agent.

  • idinteger

    ID of the user.

  • job_titlestring

    Job title of the user.

  • languagestring

    Language of the user.

  • mobileinteger

    Mobile number of the user.

  • namestring

    Name of the user.

  • phoneinteger

    Telephone number of the user.

  • time_zonestring

    Time zone in which the user resides.

  • updated_atstring

    User updated timestamp.

department

Use the sample code shown on the right pane > Sample code tab, to retrieve information of the department.

Attributes of the department object

  • created_atstring

    Department created timestamp.

  • custom_fieldobject

    Key value pairs containing names and values of custom fields.

  • descriptionstring

    A short description of the department.

  • idinteger

    ID of the department.

  • namestring

    Name of the department.

  • updated_atstring

    Department updated timestamp.

Change details page

An app deployed on the Change details page can use the client.data.get(<objectName>) data method and retrieve the following objects:

change

Use the sample code shown on the right pane > Sample code tab, to retrieve information of the change.

Attributes of the change object

  • attachmentsarray of objects

    Change attachments.

  • cc_emailobject of arrays

    Email address added in the 'cc' field of the change.

  • change_typestring

    This field categorizes the change according to the different kinds of issues your support team deals with.

  • created_atstring

    Change creation timestamp.

  • custom_fieldobject

    Key value pairs containing the names and values of custom fields.

  • department_idinteger

    ID of the department to which this change belongs.

  • descriptionstring

    Content of the change in plain text.

  • email_config_idinteger

    ID of email config which is used for this change.

  • group_idinteger

    ID of the group to which the change has been assigned.

  • idinteger

    ID of the change.

  • owner_idinteger

    ID of the agent to whom the change has been assigned.

  • priorityinteger

    Change priority value.

    Possible values:

    1: Low priority

    2: Medium priority

    3: High priority

    4: Urgent

  • priority_namestring

    Change priority text.

  • requester_idinteger

    User ID of the requester. For existing contacts, the requester_id can be passed instead of the requester's email.

  • statusinteger

    Change status value.

    Possible values:

    1: Open

    2: Planning

    3: Awaiting Approval

    4: Pending Release

    5: Pending Review

    6: Closed

  • status_namestring

    Change status text.

  • subjectstring

    Subject of the change.

  • updated_atstring

    Change updated timestamp.

requester

Use the sample code shown on the right pane > Sample code tab, to retrieve information of a requester.

Attributes of the requester object

  • activeboolean

    Set to 'true' if the user has been verified.

  • addressstring

    Address of the user.

  • created_atstring

    User creation timestamp.

  • custom_fieldobject

    Key value pairs containing the names and values of the custom fields.

  • deletedboolean

    Set to 'true' if the user has been deleted.

  • descriptionstring

    A short description of the user.

  • emailstring

    Primary email address of the user. If you want to associate additional email(s) with this user, use the other_emails attribute.

  • external_idinteger

    ID of the user in an external system.

  • helpdesk_agentboolean

    Set to 'true' if the user is an agent.

  • idinteger

    ID of the user.

  • job_titlestring

    Job title of the user.

  • languagestring

    Language of the user.

  • mobileinteger

    Mobile number of the user.

  • namestring

    Name of the user.

  • phoneinteger

    Telephone number of the user.

  • time_zonestring

    Time zone in which the user resides.

  • updated_atstring

    User updated timestamp.

agent

Use the sample code shown on the right pane > Sample code tab, to retrieve information of an agent.

Attributes of the agent object

  • activeboolean

    Set to 'true' if the user has been verified.

  • addressstring

    Address of the user.

  • created_atstring

    User creation timestamp.

  • deletedboolean

    Set to 'true' if the user has been deleted.

  • descriptionstring

    A short description of the user.

  • emailstring

    Primary email address of the user.

    If you want to associate additional email(s) with this user, use the other_emails attribute.

  • external_idinteger

    ID of the user in an external system.

  • helpdesk_agentboolean

    Set to 'true' if the user is an agent.

  • idinteger

    ID of the user.

  • job_titlestring

    Job title of the user.

  • languagestring

    Language of the user.

  • mobileinteger

    Mobile number of the user.

  • namestring

    Name of the user.

  • phoneinteger

    Telephone number of the user.

  • time_zonestring

    Time zone in which the user resides.

  • updated_atstring

    User updated timestamp.

group

Use the sample code shown on the right pane > Sample code tab, to retrieve information of the group.

Attributes of the group object

  • agent_idsarray of integers

    Array of agent IDs separated by commas.

  • idinteger

    ID of the group.

  • namestring

    Name of the group.

backoutPlan

Use the sample code shown on the right pane > Sample code tab, to retrieve description of the backout plan.

Attributes of the backoutPlan object

  • backoutPlanstring

    Description of the backout plan.

changeImpact

Use the sample code shown on the right pane > Sample code tab, to retrieve description of the change impact.

Attributes of the changeImpact object

  • changeImpactstring

    Description of the change impact.

changePlan

Use the sample code shown on the right pane > Sample code tab, to retrieve description of the change plan.

Attributes of the changePlan object

  • changePlanstring

    Description of the change plan.

changeReason

Use the sample code shown on the right pane > Sample code tab, to retrieve description of the change reason.

Attributes of the changeReason object

  • changeReasonstring

    Description of the change reason.

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_idinteger

    ID of the associated agent (managed by).

  • agent_namestring

    Name of the associated agent (managed by).

  • asset_tagstring

    Asset tag of the asset.

  • assigned_onstring

    Date at which the asset is assigned.

  • business_impactstring

    Name of the impact.

    Possible values:

    1: Low

    2: Medium

    3: High

  • ci_type_idinteger

    ID of the asset type.

  • ci_type_namestring

    Name of the asset type.

  • department_idinteger

    ID of the associated department.

  • department_namestring

    Name of the associated department.

  • descriptionstring

    Description of the asset.

  • display_idinteger

    Display ID of the asset.

  • group_idinteger

    ID of the associated agent group (managed by group).

  • impactinteger

    ID of the impact.

  • idinteger

    ID of the asset.

  • location_idinteger

    ID of the associated location.

  • location_namestring

    Name of the location associated to the asset.

  • namestring

    Name of the asset.

  • product_namestring

    Name of the product associated to the asset.

  • state_namestring

    Name of the state associated to the asset.

  • usage_typeinteger

    Usage type of the asset.

    Possible values:

    1: Permanent

    2: Loaner

  • used_bystring

    Name of the associated user (used by).

  • user_idinteger

    ID of the associated user (used by).

  • vendor_namestring

    Name of the vendor associated to the asset.