node-quickbooks
node-quickbooks copied to clipboard
Don't know if i shall add it to to issues but no documentaion for refreshAccessToken Function
Like the documentation is very poor I didn't it was there or not until I read the package files myself, please update the documentation
Were you able to use refreshToken? I was not. I ended up using API approach.
Yes, it is there and I was able to use it.
qbo.refreshAccessToken((err, accessToken) => {
//callback
});
- This will set a new access token and refresh token into qbo object
- It also provides new accessTokenen in the callback
Reference - https://github.com/mcohen01/node-quickbooks/blob/master/index.js#:~:text=*/-,QuickBooks.prototype.refreshAccessToken%20%3D%20function(callback)%20%7B,%7D%3B,-/**
Thanks man :) Though a documentation would help.
Thanks! I'm fairly new to react and oauth in general. I'm struggling with handling the flow of this. So get the qbo via new Quickbooks. Then I attempt to use qbo to get a list of accounts via qbo.findAccounts. I get an error that the token is expired. When do I run the qbo.refreshAccessToken and what do I do with the token once I get it? Do I run it after I get the error response from the findAccounts fails or do I run it before to ensure it's refreshed before attempting to find the accounts? If I run it before what do I do with this? I run the qbo.refreshAccessToken and I get the token back, what do I do with the token so that I can start using the api with the new token? Thanks!