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 |
apiKey |
string | API key |
Methods
createCompany(data, cb) → {void}
Creates company.
Creates company.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | [description] |
cb |
Freshdesk.requestCallback | Callback function Freshdesk.requestCallback |
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 |
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 |
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 |
createTimeEntry(ticket_id, data, cb)
Create a Time Entry
Note:
- If the
time_spent
is not specified and thetimer_running
attribute is not specified, then thetimer_running
attribute will automatically be set totrue
- If the
start_time
is specified and thetimer_running
attribute is not specified, then thetimer_running
attribute will automatically be set totrue
- The
start_time
cannot be greater than the current time - The
start_time
cannot be given in the API request if thetimer_running
attribute is set tofalse
Create a Time Entry
Note:
- If the
time_spent
is not specified and thetimer_running
attribute is not specified, then thetimer_running
attribute will automatically be set totrue
- If the
start_time
is specified and thetimer_running
attribute is not specified, then thetimer_running
attribute will automatically be set totrue
- The
start_time
cannot be greater than the current time - The
start_time
cannot be given in the API request if thetimer_running
attribute is set tofalse
Parameters:
Name | Type | Description |
---|---|---|
ticket_id |
Number | Ticket Number ID |
data |
Freshdesk.TimeEntryData | New time entry data |
cb |
Freshdesk.requestCallback | Callback function Freshdesk.requestCallback |
createTranslatedSolutionArticle(id, language_code, data, cb)
Create a translated solution article
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Create a translated solution article
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |
createTranslatedSolutionCategory(id, language_code, data, cb)
Create a translated solution category
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Create a translated solution category
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |
createTranslatedSolutionFolder(id, language_code, data, cb)
Create a translated solution folder
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Create a translated solution folder
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |
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 |
deleteCompany(id, cb)
Delete a Company.
Delete a Company.
Note:
- Deleting a company does not delete the contacts that are associated with it. However the association will be removed.
- Once deleted, a company cannot be restored.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | Company ID |
cb |
Freshdesk.requestCallback | Callback function Freshdesk.requestCallback |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
* |
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 |
getCompany(id, cb)
View a Company.
View a Company.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | Company ID |
cb |
Freshdesk.requestCallback.<Freshdesk.CompanyViewData> | Callback function |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
listAllRoles(cb) → {void}
List All Roles.
List All Roles.
Parameters:
Name | Type | Description |
---|---|---|
cb |
Freshdesk.requestCallback | Callback function Freshdesk.requestCallback |
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 |
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 |
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 |
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 : |
cb |
Freshdesk.requestCallback.<Array.<Freshdesk.Tickets>> | Callback function Freshdesk.requestCallback |
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
|
||||||||||||||||||||||||
cb |
Freshdesk.requestCallback.<Array.<Freshdesk.TimeEntryResponse>> | Callback function Freshdesk.requestCallback |
searchCompany(params, cb)
Search Companies.
Search Companies.
Parameters:
Name | Type | Description |
---|---|---|
params |
* | Object containing parameter keys (name) |
cb |
Freshdesk.requestCallback.<Freshdesk.CompanyViewData> | Callback function |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
updateTimeEntry(id, data, cb)
Update a Time Entry
Note:
- The
start_time
cannot be updated if the timer is already running - The
start_time
cannot be be updated unless thetimer_running
attribute is updated fromtrue
tofalse
- The
start_time
cannot be greater than the current time - The
timer_running
attribute cannot be set to the same value as before - The
agent_id
cannot be updated if the timer is already running
Update a Time Entry
Note:
- The
start_time
cannot be updated if the timer is already running - The
start_time
cannot be be updated unless thetimer_running
attribute is updated fromtrue
tofalse
- The
start_time
cannot be greater than the current time - The
timer_running
attribute cannot be set to the same value as before - 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 |
updateTranslatedSolutionArticle(id, language_code, data, cb)
Update a translated solution article
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Update a translated solution article
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |
updateTranslatedSolutionCategory(id, language_code, data, cb)
Update a translated solution category
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Update a translated solution category
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |
updateTranslatedSolutionFolder(id, language_code, data, cb)
Update a translated solution folder
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- Configured languages can be retrieved from Helpdesk Settings
Update a translated solution folder
Note:
- Multilingual Feature must be enabled for the account
- Supported languages have to be configured from Admin > General Settings > Helpdesk
- 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 |