Created
June 1, 2016 12:51
-
-
Save mwoodbri/49488d846ac6930f48214bd6e391c648 to your computer and use it in GitHub Desktop.
xero-quickstart
This file contains 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
var consumer_key = '...'; | |
var request = require('request').defaults({ | |
oauth: { | |
consumer_key: consumer_key, | |
token: consumer_key, | |
signature_method : 'RSA-SHA1', | |
private_key: require('fs').readFileSync('privatekey.pem') | |
}, | |
json: true | |
}); | |
request('https://api.xero.com/api.xro/2.0/Organisation', function(e, r, organisation) { | |
console.log(e || organisation); | |
}); |
This file contains 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
{ | |
"name": "xero-quickstart", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"request": "^2.72.0" | |
} | |
} |
This file contains 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
-----BEGIN RSA PRIVATE KEY----- | |
... | |
-----END RSA PRIVATE KEY----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment