I have attempted to set up xero-node passing in the consumer key and consumer secret along with the app name as the user Agent. However when I do a test call e.g. xeroClient.core.users.getUsers() the code just seems to freeze not giving any errors however I cannot move any further.
Asked
Active
Viewed 95 times
0
-
You can see a gist here: https://gist.github.com/BrianSHenderson/c27f719803afc7f21583c27670716e8f – user2243825 Jan 10 '18 at 13:26
1 Answers
0
Are you able to post a gist of the code you are using?
What App type are you using (Private, Public or Partner)?
Have you seen the code samples on the main GitHub page? There is also a sample app here: https://github.com/XeroAPI/xero-node-sample-app

philals
- 390
- 2
- 5
-
Thank you for getting back to me, its a Private App Type (I didn't see an example Private type in the same app). – user2243825 Jan 09 '18 at 08:52
-
const xero = require('xero-node'); const config = { userAgent : "NMM", consumerKey: "XXXX", consumerSecret: "XXXX", privateKeyPath: `${process.env.PWD}/public/xeroprivatekey.pem`, }; – user2243825 Jan 09 '18 at 08:53
-
-
xeroClient.core.users.getUsers() .then(contacts => { console.log('**') contacts.forEach(contact => { console.log(contact.Name); }); }).catch(err => { console.log(err); }); – user2243825 Jan 09 '18 at 08:54
-
Hi. I imagine it might be an issue with the private key. See here for an issue: https://github.com/XeroAPI/xero-node/issues/116 There is an example here: https://github.com/XeroAPI/xero-node#app-usage Can you copy and paste that one and give it ago? – philals Jan 10 '18 at 18:07