Question

How to get the realmId from Quickbooks Online in Oauth2.0 flow


Userlevel 7
Badge +6

When setting up an app on the developer platform for Quickbooks Online I need to get one value that QBO gives in the Oauth2.0 flow but I cannot figure out a way to get this value. 

 

So my Auth URL is set correctly as so:

And when I authenticate via this flow intuit redirects back to my app url like so (I removed the values but the keys are the same)

https://zapier.com/dashboard/auth/oauth/return/AppTTTTCLIAPI/?code=stuff&state=blue&realmId=xyz

 

NOTE: See the realmId=xyz at the end. That is the value I need. This is the ONLY time this value is given in the Oauth flow and there’s no API endpoint to request this value again. 

 

 

This is basically happening where the red arrow is. it’s after the user goes to the Auth URL at intuit, and before Zapier calls the POST to the Access Token Request

Typically I would get the contents of a response to the Access Token Request though {{bundle.inputData.field}} or {{bundle.authData.field}} but since this realmId comes before the POST to the Access Token Request URL the information is not stored or at least I don’t know how to access it. 

 

So I created a Computed Field, called realmId. 

I thought forsure this would be the way to capture that value (and yes I did realmId and realmid on different attempts to see if it was a case sensitivity issue)

 

But then I get this as intuit is redirecting back to my Zapier App: 

 

The crazy part is ON THAT PAGE, check out the URL if I scroll to the right:

the realmId is in the URL!!!!

 

So I assume that Zapier’s Oauth2.0 flow is grabing the code and state from the query parameters, but how can I tell it to grab the realmId as well?

 

I thought maybe switching to Code Mode on the Auth URL would give me the ability to process the returning information from intuit but no. 

All it shows is the structure of the URL and then it returns the URL, there’s no “calling it” and then “handleing the response”

 

Any help you can provide would be awesome!


2 replies

Userlevel 7
Badge +6

calling @ikbelkirasan Obi-wan, you’re my only hope?

Userlevel 7
Badge +8

Hey @PaulKortman - Sure, I’ll try and help!

I think you can access realmId when you request the access token. You should be able to find it in bundle.cleanedRequest.querystring.realmId. No need for the computed field, I guess. :)

Reply