Best answer

Quickbooks Integration: This account is expired. Please reconnect it here

  • 19 April 2023
  • 3 replies
  • 315 views

Userlevel 1
Badge

I have created an app by zapier developer plataform to get new access token by quickbooks online, but every hour that the access token expires zapier disconnect the connection in My Apps > Custom Integrations and I have to reconnect again, but my Connection with quickbooks I did by email and password it doesn't have anything to do with the access token or refresh token.

After I reconnect it continues working by 1 hour, after the token expired it havens again, asking to reconnect.  

 

 

After reconnect, it works for 1 more hour.

 

 

icon

Best answer by DanielMasterpiece 20 April 2023, 20:19

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +9

Hey there, @DanielMasterpiece - thanks for reaching out in community! Since this is related to a custom integration I’m going to move your question to our dev forum for some more technical eyes on this. 🙂

 

Userlevel 7
Badge +11

Hey @DanielMasterpiece!

Have you checked out the documentation for the Zapier dev platform? I found this, which I believe is what you’re looking to do: https://platform.zapier.com/quickstart/auth#refresh-token-request

And here’s some information from the Quickbooks side: https://help.developer.intuit.com/s/article/Handling-OAuth-token-expiration

And on that page, you’ll see a link to this page: https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0#refresh-tokens

Hopefully that gets you on the right path :) 

Userlevel 1
Badge

Hello everyone just to update, I found a solution:

In Refresh Token Request I switched to CODE MODE:
 

const options = {
  url: 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer',
  method: 'POST',
  headers: {
    'content-type': 'application/x-www-form-urlencoded',
    'accept': 'application/json',
    'Authorization': 'Basic ' + btoa(process.env.CLIENT_ID+':'+process.env.CLIENT_SECRET)
  },
  params: {

  },
  body: {
    'refresh_token': bundle.authData.refresh_token,
    'grant_type': 'refresh_token'
  }
}


return z.request(options)
  .then((response) => {
    response.throwForStatus();
    const results = response.json;

    // You can do any parsing you need for results here before returning them

    return results;
  });

 

in Test I switched to CODE MODE:

const options = {
  url: '<API endpoint URL to test authentication credentials( put yours URL Endpoint)>',
  method: 'GET',
  headers: {
    'Accept': 'application/json',
    'Authorization': `Bearer ${bundle.authData.access_token}`
  },
  params: {

  }
}

return z.request(options).then((response) => {
  const res = response.json;
if (res.expiredError) {
  // What to do here?
  throw new z.errors.RefreshAuthError();
} else {
  return bundle.authData;
}
});