Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
freshdesk
Advanced tools
Readme
WARNING
This repository and corresponding NPM package are deprecated in favor of freshdesk-api.
Useful links:
npm install freshdesk-api
npm install freshdesk-api@APIv1
node-freshdesk-api
:
A NodeJS library for integrating your backend with Freshdesk.
npm install freshdesk
You'll need your API Key and the base url of your support portal handy for configuring the SDK. To get your API key, refer the Freshdesk Docs.
var _fd = require('freshdesk')
var Freshdesk = new _fd('http://mydomain.freshdesk.com', 'MyR4nD0MAp1KeY');
Freshdesk.listTickets(function(err, res, body) {
console.log("The tickets are: ", body);
});
Most of the functions pertaining Tickets and Users are implemented. For unimplemented routes, you can use the raw routes, such as Freshdesk.get()
to make the requests directly.
Here are the currently supported functions. For a detailed explanation of the arguments you have to pass to each functions, refer to the official docs.
createTicket (data , cb )
method: post
url: /helpdesk/tickets.json
,
listTickets (cb )
method: get
url: /helpdesk/tickets.json
allTickets (cb )
method: get
url: /helpdesk/tickets/filter/all_tickets?format=json
getTicket (id , cb )
method: get
url: /helpdesk/tickets/#{id}.json
updateTicket (id , cb )
method: put
url: /helpdesk/tickets/#{id}.json
, data
pickTicket (id , cb )
method: put
url: /helpdesk/tickets/#{id}/pick_tickets.json
, {}
deleteTicket (id , cb )
method: delete
url: /helpdesk/tickets/#{id}.json
restoreTicket (id , cb )
method: put
url: /helpdesk/tickets/#{id}/restore.json
assignTicket (id , user_id <freshdesk_user_id>, cb )
method: put
url: /helpdesk/tickets/#{id}/assign.json?responder_id=#{user_id}
ticketFields (cb )
method: get
url: /ticket_fields.json
addNoteToTicket (id , note , cb )
method: post
url: /helpdesk/tickets/#{id}/conversations/note.json
createUser (cb )
method: post
url: /contacts.json
, contact
listUsers (cb )
method: get
url: /contacts.json
state=all'
updateUser (id , cb )
method: put
url: /contacts/#{id}.json
, data
getUserByEmail (email_id , cb )
method: GET
url: /contacts.json?state=all&query=#{query}
Freshdesk.pickTicket(100, function(err, res) {
console.log("My Ticket is", res.body);
});
var ticket = {
'helpdesk_ticket': {
'description': "Hello, I'm an ephemeral ticket created from the API. I will be deleted as soon as my creator wishes so...",
'subject': "Efemeros",
'email': 'efemeros@mailinator.com',
'priority': '1',
'status': '2',
'custom_field': {
// remove these comments, as they're not valid json
// any custom fields you'd have configured in your app...
// like:
// 'location_XXXXX': 'Tristan da Cunha'
// where XXXXX is a (possibly random) ID appended to your custom field
// This would most probably be different for each portal.
}
}
};
Freshdesk.createTicket(100, function(err, res) {
console.log("My Ticket is", res.body);
});
If you feel the need to add more functions, just fork this repo, add your functions and submit a PR. Wanna improve docs or the source, or even add tests? You're more than welcome :)
This is just a side project I created because I needed it, and the existing node-freshdesk
lacked some functions which my project needed.
FAQs
A nodejs sdk for the Freshdesk API. Some major routes are implemented, but this SDK exposes the basic GET, POST, PUT, DELETE routes so that you can fill in the gaps in your apps for the unimplemented routes, and send a pull request to complete it!
The npm package freshdesk receives a total of 18 weekly downloads. As such, freshdesk popularity was classified as not popular.
We found that freshdesk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.