
Security News
GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.
@liongard/connectwise-rest
Advanced tools
A nodejs module for interacting with the ConnectWise REST API.
A nodejs module for interacting with the ConnectWise REST API. This module is currently under construction. This module provides bindings for ease of development against the ConnectWise REST API.
See the documentation here
Create a new API key, or API Only Member, then instantiate the module.
var ConnectWiseRest = require('connectwise-rest');
var cw = new ConnectWiseRest({
companyId: 'company',
companyUrl: 'your.connectwise.com',
publicKey: '<public key>',
privateKey: '<private key>',
entryPoint: 'v4_6_release', // optional, defaults to 'v4_6_release'
timeout: 20000, // optional, request connection timeout in ms, defaults to 20000
retry: false, // optional, defaults to false
retryOptions: { // optional, override retry behavior, defaults as shown
retries: 4, // maximum number of retries
minTimeout: 50, // number of ms to wait between retries
maxTimeout: 20000, // maximum number of ms between retries
randomize: true, // randomize timeouts
},
debug: false, // optional, enable debug logging
logger: (level, text, meta) => { } // optional, pass in logging function
});
cw.ServiceDeskAPI.Tickets.getTicketById(1234)
.then(function (result){
//do something with results
})
.catch(function (error){
//handle errors
});
Or if you only require access to one API component:
var ConnectWiseRest = require('connectwise-rest');
var tickets = new ConnectWiseRest(options).ServiceDeskAPI.Tickets;
tickets.getTicketById(1234)
.then(function (result){
//do something with results
})
.catch(function (error){
//handle errors
});
You can also manually access the API:
var ConnectWiseRest = require('connectwise-rest');
var api = new ConnectWiseRest(options).API.api;
api('/path/to/api', 'POST', {
'param1': 'val1',
'param2': 'val2'
})
.then(function (result){
//do something with results
})
.catch(function (error){
//handle errors
});
To access cloud-hosted ConnectWise, use the companyUrl of api-na.myconnectwise.net and override the default entryPoint.
options = {
companyId: 'company',
companyUrl: 'api-na.myconnectwise.net',
entryPoint: 'v2016_2',
publicKey: '<public key>',
privateKey: '<private key>'
}
| Module | API | Status |
|---|---|---|
| Company API | Companies | Complete |
| Company API | CompanyTeams | Complete |
| Company API | Configurations | Complete |
| Company API | Contacts | Complete |
| Finance API | Additions | Complete |
| Finance API | Adjustments | Complete |
| Finance API | Agreements | Complete |
| Finance API | AgreementSites | Complete |
| Finance API | BoardDefaults | Complete |
| Finance API | WorkRoles | Complete |
| Finance API | WorkTypeExclusions | Complete |
| Finance API | WorkTypes | Complete |
| Project API | Projects | Complete |
| ScheduleAPI | ScheduleEntries | Complete |
| ScheduleAPI | ScheduleTypes | Complete |
| Service Desk API | Boards | Complete |
| Service Desk API | BoardTeams | Complete |
| Service Desk API | Priorities | Complete |
| Service Desk API | ServiceNotes | Complete |
| Service Desk API | Statuses | Complete |
| Service Desk API | Tickets | Complete |
| System API | Members | Complete |
| System API | Reports | Complete |
| Time API | TimeEntries | Complete |
Get ticket 1234 and print ticket number, summary and status.
tickets.getTicketById(1234)
.then(function (res) { console.log(res.id, res.summary, res.status.name); })
.catch(function (err) { console.log(err); });
Create new ticket on service board, then print the returned ticket number, or any errors
tickets.createTicket({
summary: "This is the summary",
board: {
name: "Service Board"
},
company: {
identifier: "ABC" //company ID
},
initialDescription: "ticket description",
recordType: "ServiceTicket"
//can also pass in any other Ticket object settings as needed
})
.then(function (res) { console.log(res.id); });
.catch(function (err) { console.log(err); });
Change the status of a ticket
updateTicket(1234, [{
op: 'replace',
path: 'status',
value: {id: 123} //id of the status to change to, find with boards.getBoards and status.getStatuses
}, {
//second or more operations
}])
.then(function(res) { //do something with returned ticket });
.catch(function(err) { //do something with errors });
Valid example conditions string:
var conditions = '(contact/name like "Fred%" and closedFlag = false) and dateEntered > [2015-12-23T05:53:27Z] or summary contains "test" AND summary != "Some Summary"'
Error message returned from server when invalid conditions are passed in:
Expected a boolean value, not a numeric. String values should be enclosed with double or single quotes; DateTime values should be enclosed in square brackets; numbers should consist of only digits, and optionally a decimal point and a negation sign; boolean values should be indicated with the keywords true or false; null values should be indicated by the keyword null.
FAQs
A nodejs module for interacting with the ConnectWise REST API.
We found that @liongard/connectwise-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.