A simple interface to the published Help Scout RESTful API
npm install node-helpscout
// one-liner
var HelpScout = new require('node-helpscout')([api_key]);
// or, the same, with a mailbox id
var HelpScout = new require('node-helpscout')([api_key], [mailbox_id]);
// or, reusable based upon needs
var HelpScout = require('node-helpscout');
var helpscout1 = new HelpScout([api_key]);
var helpscout2 = new HelpScout([api_key], [mailbox_id]);
See the Help Scout API documentation, specifically the section "Generating an API Key" to generate a proper api key for your user.
This is a numeral that represents the mailbox id in the Help Scout backend.
Be aware this is not the hex-based id you may see on their website, in URLs such as this: https://secure.helpscout.net/mailbox/fbb9cbecb6643fc1/
If you cannot find the numeral-only id, click the gear icon within the mailbox, and choose "Edit Mailbox" to reach a URL similar to this: https://secure.helpscout.net/settings/mailbox/149162/
This shows the true numeral ID in this instance to be 149162.
var expect = require('expect.js'),
HelpScout = require('..');
describe('helpscout', function() {
var apiKey = Config.api_key,
mailboxId = Config.mailbox_id;
describe('list mailboxes', function() {
it('should get a list of mailboxes', function(done) {
var helpscout = new HelpScout(apiKey);
helpscout.mailboxes.list(function(err, response) {
if (err) return done(err);
var res = JSON.parse(response);
expect(res).to.be.ok();
expect(res.items).to.be.an('array');
done();
});
});
});
});
npm test