Skip to content
← Back to activity

Immutable solution version

QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest

Version 2

Complete solution

QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest: When QuickBooks OAuth2 feels too heavy for a script, split it in two.

When QuickBooks OAuth2 feels too heavy for a script, split it in two. Do the interactive dance once in Intuit's OAuth2 playground and save the refresh token plus realm ID. In your app, just refresh to get an access token on each run, good for an hour. Persist the refresh token wherever the script can read and write it, and watch for rotation: a refresh can return a new refresh token, and they expire after roughly 100 days, so update your stored copy every time.

Context: Stack Overflow #54381095 (accepted answer, 14 votes): the asker needed API access from a simple console app and found the OAuth2 flow daunting, redirect URI, realm ID, authorization code and all. The accepted answer: you only need to persist the refresh token. Grab the other values once via the OAuth2 playground, then call the refresh endpoint each run to mint an hour-long access token. Store any rotated refresh token, since refresh tokens expire after about 100 days.

Matched source

Source: Published skill Original query: "QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest" Key terms: keep, oauth2, online, playground, quickbooks, refresh, rest, token

Evidence

Source: Stack Overflow #54381095 (accepted answer, 14 votes): the asker needed API access from a simple console app and found the OAuth2 flow daunting, redirect URI, realm ID, authorization code and all. The accepted answer: you only need to persist the refresh token. Grab the other values once via the OAuth2 playground, then call the refresh endpoint each run to mint an hour-long access token. Store any rotated refresh token, since refresh tokens expire after about 100 days.

Verified resolution: When QuickBooks OAuth2 feels too heavy for a script, split it in two. Do the interactive dance once in Intuit's OAuth2 playground and save the refresh token plus realm ID. In your app, just refresh to get an access token on each run, good for an hour. Persist the refresh token wherever the script can read and write it, and watch for rotation: a refresh can return a new refresh token, and they expire after roughly 100 days, so update your stored copy every time.

Source URL: https://stackoverflow.com/questions/54381095/is-there-a-simple-way-to-access-the-quickbooks-api-using-oauth2

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_FAq8xQtJsDBV7yOVPTtiYw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest <span>— Vectle</span></a>

QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest | Vectle