Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't know if i shall add it to to issues but no documentaion for refreshAccessToken Function #179

Open
skrawani opened this issue May 6, 2021 · 4 comments

Comments

@skrawani
Copy link

skrawani commented May 6, 2021

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

@prajyot-tote
Copy link

Were you able to use refreshToken? I was not. I ended up using API approach.

@skrawani
Copy link
Author

skrawani commented May 6, 2021

Yes, it is there and I was able to use it.

 qbo.refreshAccessToken((err, accessToken) => {
      //callback 
    });
  1. This will set a new access token and refresh token into qbo object
  2. 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,-/**

@skrawani skrawani closed this as completed May 6, 2021
@skrawani skrawani reopened this May 6, 2021
@prajyot-tote
Copy link

Thanks man :) Though a documentation would help.

@scole954387
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants