Class: Freshdesk

client~Freshdesk(baseUrl, apiKey)

Freshdesk APIv2 client.

Constructor

new Freshdesk(baseUrl, apiKey)

Freshdesk APIv2 client

.

Freshdesk APIv2 client

Parameters:
Name Type Description
baseUrl string

Base URL for the API calls, for example https://demo.freshdesk.com

apiKey string

API key

Source:

Methods

createCompany(data, cb) → {void}

Creates company.

Creates company.

Parameters:
Name Type Description
data Object

[description]

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:
Returns:

void

Type
void

createSolutionArticle(id, data, cb)

Create a Solution Article

.

Create a Solution Article

Parameters:
Name Type Description
id Number

Solution folder ID

data Freshdesk.SolutionFolderData

New solution article data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createSolutionCategory(data, cb)

Create a Solution Category

.

Create a Solution Category

Parameters:
Name Type Description
data Freshdesk.SolutionCategoryData

New solution category data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createSolutionFolder(id, data, cb)

Create a Solution Folder

.

Create a Solution Folder

Parameters:
Name Type Description
id Number

Solution category ID

data Freshdesk.SolutionFolderData

New solution folder data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createTimeEntry(ticket_id, data, cb)

Create a Time Entry

Note:

  1. If the time_spent is not specified and the timer_running attribute is not specified, then the timer_running attribute will automatically be set to true
  2. If the start_time is specified and the timer_running attribute is not specified, then the timer_running attribute will automatically be set to true
  3. The start_time cannot be greater than the current time
  4. The start_time cannot be given in the API request if the timer_running attribute is set to false
.

Create a Time Entry

Note:

  1. If the time_spent is not specified and the timer_running attribute is not specified, then the timer_running attribute will automatically be set to true
  2. If the start_time is specified and the timer_running attribute is not specified, then the timer_running attribute will automatically be set to true
  3. The start_time cannot be greater than the current time
  4. The start_time cannot be given in the API request if the timer_running attribute is set to false
Parameters:
Name Type Description
ticket_id Number

Ticket Number ID

data Freshdesk.TimeEntryData

New time entry data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createTranslatedSolutionArticle(id, language_code, data, cb)

Create a translated solution article

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Create a translated solution article

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution article ID

language_code String

Language code for the translated solution article

data Freshdesk.SolutionArticleData

Translated solution article data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createTranslatedSolutionCategory(id, language_code, data, cb)

Create a translated solution category

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Create a translated solution category

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution category ID

language_code String

Language code for the translated solution category

data Freshdesk.SolutionCategoryData

Translated solution category data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

createTranslatedSolutionFolder(id, language_code, data, cb)

Create a translated solution folder

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Create a translated solution folder

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution folder ID

language_code String

Language code for the translated solution folder

data Freshdesk.SolutionFolderData

Translated solution folder data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

currentAgent(cb)

Currently Authenticated Agent.

Currently Authenticated Agent.

Parameters:
Name Type Description
cb Freshdesk.requestCallback.<Freshdesk.AgentResponse>

Callback function Freshdesk.requestCallback

Source:
See:

deleteAgent(id, cb)

Delete an Agent.

Delete an Agent.

Parameters:
Name Type Description
id Number

Agent ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

deleteCompany(id, cb)

Delete a Company.

Delete a Company.

Note:

  1. Deleting a company does not delete the contacts that are associated with it. However the association will be removed.
  2. Once deleted, a company cannot be restored.
Parameters:
Name Type Description
id Number

Company ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

deleteSolutionArticle(id, cb)

Delete a Solution Article

Note: When deleted, all translated versions will be deleted too.

Delete a Solution Article

Note: When deleted, all translated versions will be deleted too.

Parameters:
Name Type Description
id Number

Solution article ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

deleteSolutionCategory(id, cb)

Delete a Solution Category

Note: When deleted, all translated versions will be deleted too.

Delete a Solution Category

Note: When deleted, all translated versions will be deleted too.

Parameters:
Name Type Description
id Number

Solution category ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

deleteSolutionFolder(id, cb)

Delete a Solution Folder

Note: When deleted, all translated versions will be deleted too.

Delete a Solution Folder

Note: When deleted, all translated versions will be deleted too.

Parameters:
Name Type Description
id Number

Solution folder ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

deleteTimeEntry(id, cb)

Delete a Time Entry

Note: Deleted time entries cannot be restored.

Delete a Time Entry

Note: Deleted time entries cannot be restored.

Parameters:
Name Type Description
id Number

Time entry ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

filterCompanies(query, cb)

Filter Companies.

Filter Companies.

Allows to get a list of companies filtered with a query.

Query example:: "(company_field:integer OR company_field:'string') AND company_field:boolean"

More documentation on the Freshdesk Developer Portal (link below).

Parameters:
Name Type Description
query String

The query, used to filter companies

cb Freshdesk.requestCallback.<Array.<Freshdesk.CompanyViewData>>

Callback function Freshdesk.requestCallback

Source:
See:

filterContacts(query, cb)

Filter Contacts.

Filter Contacts.

Allows to get a list of contacts filtered with a query.

Query example:: "(contact_field:integer OR contact_field:'string') AND contact_field:boolean"

More documentation on the Freshdesk Developer Portal (link below).

Parameters:
Name Type Description
query String

The query, used to filter contacts

cb Freshdesk.requestCallback.<Array.<Freshdesk.ContactViewData>>

Callback function Freshdesk.requestCallback

Source:
See:

filterTickets(query, page, cb)

Filter tickets

.

Filter tickets

Parameters:
Name Type Description
query *

Query tickets, refer https://developers.freshdesk.com/api/#filter_tickets

page *

Page number for pagination

cb *
Source:

getAgent(id, cb)

View an Agent.

View an Agent.

Parameters:
Name Type Description
id Number

Agent ID

cb Freshdesk.requestCallback.<Freshdesk.AgentResponse>

Callback function Freshdesk.requestCallback

Source:
See:

getCompany(id, cb)

View a Company.

View a Company.

Parameters:
Name Type Description
id Number

Company ID

cb Freshdesk.requestCallback.<Freshdesk.CompanyViewData>

Callback function

Source:
See:

getRole(id, cb)

View a Role.

View a Role.

Parameters:
Name Type Description
id Number

Unique ID of the Role

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getSettings(cb)

View Helpdesk Settings

.

View Helpdesk Settings

Parameters:
Name Type Description
cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getSolutionArticle(id, cb)

View a Solution Article

.

View a Solution Article

Parameters:
Name Type Description
id Number

Solution article ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getSolutionCategory(id, cb)

View a Solution Category

.

View a Solution Category

Parameters:
Name Type Description
id Number

Solution category ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getSolutionFolder(id, cb)

View a Solution Folder

.

View a Solution Folder

Parameters:
Name Type Description
id Number

Solution folder ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getTranslatedSolutionArticle(id, language_code, cb)

View a translated Solution Article

.

View a translated Solution Article

Parameters:
Name Type Description
id Number

Solution article ID

language_code String

Language code for the translated solution article

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getTranslatedSolutionCategory(id, language_code, cb)

View a translated solution Category

.

View a translated solution Category

Parameters:
Name Type Description
id Number

Solution category ID

language_code String

Language code for the translated solution category

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

getTranslatedSolutionFolder(id, language_code, cb)

View a translated solution Folder

.

View a translated solution Folder

Parameters:
Name Type Description
id Number

Solution folder ID

language_code String

Language code for the translated solution folder

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

listAllAgents(params, cb)

List All Agents.

List All Agents.

Parameters:
Name Type Description
params Freshdesk.AgentFilter

Agent filter

cb Freshdesk.requestCallback.<Array.<Freshdesk.AgentResponse>>

Callback function Freshdesk.requestCallback

Source:
See:

listAllCompanies(params, cb)

List All Companies.

List All Companies.

Parameters:
Name Type Description
params *

Object containing parameter keys

cb Freshdesk.requestCallback.<Array.<Freshdesk.CompanyViewData>>

Callback function Freshdesk.requestCallback

Source:
See:

listAllRoles(cb) → {void}

List All Roles.

List All Roles.

Parameters:
Name Type Description
cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:
Returns:

void

Type
void

listAllSolutionCategories(cb)

List all Solution Categories

.

List all Solution Categories

Parameters:
Name Type Description
cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

listAllSolutionCategoryFolders(id, cb)

List all Solution Folders in a Category

.

List all Solution Folders in a Category

Parameters:
Name Type Description
id Number

Solution category ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

listAllSolutionFolderArticles(id, cb)

List all Solution Articles in a Folder

.

List all Solution Articles in a Folder

Parameters:
Name Type Description
id Number

Solution folder ID

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

listAllTickets(params, cb)

listAllTickets API method.

listAllTickets API method.

Parameters:
Name Type Description
params Freshdesk.TicketsFilter

Dictionary with request parameters for the API method, for example : {"company_id": "YOUR_ID"}

cb Freshdesk.requestCallback.<Array.<Freshdesk.Tickets>>

Callback function Freshdesk.requestCallback

Source:
See:

listAllTimeEntries(params, cb)

List All Time Entries

.

List All Time Entries

Parameters:
Name Type Description
params Object

Filters to view only specific time entries

Properties
Name Type Attributes Description
company_id Object <optional>

Filter by Company ID

agent_id Object <optional>

Filter by Agent ID

executed_before Date <optional>

Filter by executed date

executed_after Date <optional>

Filter by executed date

billable Boolean <optional>

View only billable/not billable items. Not a String, it is a Boolean

cb Freshdesk.requestCallback.<Array.<Freshdesk.TimeEntryResponse>>

Callback function Freshdesk.requestCallback

Source:
See:

searchCompany(params, cb)

Search Companies.

Search Companies.

Parameters:
Name Type Description
params *

Object containing parameter keys (name)

cb Freshdesk.requestCallback.<Freshdesk.CompanyViewData>

Callback function

Source:
See:

searchSolutionArticles(term, cb)

Search solution articles

.

Search solution articles

Parameters:
Name Type Description
term String

Keyword to search for

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

toggleTimer(id, cb)

Start/Stop Timer

.

Start/Stop Timer

Parameters:
Name Type Description
id Number

Time Entry ID

cb Freshdesk.requestCallback.<Freshdesk.TimeEntryResponse>

Callback function Freshdesk.requestCallback

Source:
See:

updateAgent(id, data, cb)

Update an Agent.

Update an Agent.

Parameters:
Name Type Description
id Number

Agent ID

data Freshdesk.AgentData

New values for Agent's fields

cb Freshdesk.requestCallback.<Freshdesk.AgentResponse>

Callback function Freshdesk.requestCallback

Source:
See:

updateCompany(id, data, cb) → {void}

Updates company.

Updates company.

Parameters:
Name Type Description
id Number

Company ID

data Freshdesk.UpdateCompanyData

New settings for company

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:
Returns:

void

Type
void

updateSolutionArticle(id, data, cb)

Update a Solution Article

.

Update a Solution Article

Parameters:
Name Type Description
id Number

Solution article ID

data Freshdesk.SolutionArticleData

Updated solution article data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

updateSolutionCategory(id, data, cb)

Update a Solution Category

.

Update a Solution Category

Parameters:
Name Type Description
id Number

Solution category ID

data Freshdesk.SolutionCategoryData

Updated solution category data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

updateSolutionFolder(id, data, cb)

Update a Solution Folder

.

Update a Solution Folder

Parameters:
Name Type Description
id Number

Solution folder ID

data Freshdesk.SolutionFolderData

Updated solution folder data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

updateTimeEntry(id, data, cb)

Update a Time Entry

Note:

  1. The start_time cannot be updated if the timer is already running
  2. The start_time cannot be be updated unless the timer_running attribute is updated from true to false
  3. The start_time cannot be greater than the current time
  4. The timer_running attribute cannot be set to the same value as before
  5. The agent_id cannot be updated if the timer is already running
.

Update a Time Entry

Note:

  1. The start_time cannot be updated if the timer is already running
  2. The start_time cannot be be updated unless the timer_running attribute is updated from true to false
  3. The start_time cannot be greater than the current time
  4. The timer_running attribute cannot be set to the same value as before
  5. The agent_id cannot be updated if the timer is already running
Parameters:
Name Type Description
id Number

Time Entry ID

data Freshdesk.TimeEntryData

New time entry data

cb Freshdesk.requestCallback.<Freshdesk.TimeEntryResponse>

Callback function Freshdesk.requestCallback

Source:
See:

updateTranslatedSolutionArticle(id, language_code, data, cb)

Update a translated solution article

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Update a translated solution article

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution article ID

language_code String

Language code for the translated solution article

data Freshdesk.SolutionArticleData

Updated translated solution article data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

updateTranslatedSolutionCategory(id, language_code, data, cb)

Update a translated solution category

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Update a translated solution category

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution category ID

language_code String

Language code for the translated solution category

data Freshdesk.SolutionCategoryData

Updated translated solution category data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See:

updateTranslatedSolutionFolder(id, language_code, data, cb)

Update a translated solution folder

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
.

Update a translated solution folder

Note:

  1. Multilingual Feature must be enabled for the account
  2. Supported languages have to be configured from Admin > General Settings > Helpdesk
  3. Configured languages can be retrieved from Helpdesk Settings
Parameters:
Name Type Description
id Number

Solution folder ID

language_code String

Language code for the translated solution folder

data Freshdesk.SolutionFolderData

Updated translated solution folder data

cb Freshdesk.requestCallback

Callback function Freshdesk.requestCallback

Source:
See: