Created
June 12, 2017 03:38
-
-
Save ryanwebjackson/9e2b76fb98985b6f288a4c26360dfb8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var express = require('express'); | |
var router = express.Router(); | |
var ConnectWiseRest = require('connectwise-rest'); | |
router.get('/cwapi', function (req, res) { | |
//debugger; | |
//var cw = new ConnectWiseRest({ | |
// companyId: 'company', | |
// companyUrl: 'support.cit-net.com', | |
// publicKey: 'dDLBNoxHhpwabKut', | |
// privateKey: 'mNVPgd3XOa3chItM', | |
// 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 | |
// } | |
//}); | |
//var api = cw.API.api; //DEBUG | |
//debugger; | |
//console.log('cw api: ', api); | |
var responseBody = 'made it here'; | |
//cw.ServiceDeskAPI.Tickets.getTicketById(1) //*Arbitrary value - might not exist* | |
// .then(function (result) { | |
// //do something with results | |
// console.log('result: ', result); | |
// responseBody = result; | |
// }) | |
// .catch(function (error) { | |
// //handle errors | |
// console.log('error: ', error); | |
// responseBody = error; | |
// }); | |
res.send('Response: ' + responseBody); | |
}); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment