Sidharth
Sidharth

Reputation: 1462

what will be the CALLBACK_URL fir intuit auth1.0?

i want to get the details of customers form my intuit account to my website by using quickbooks and api provided by them. i was following this link : Python- quickbooks

what i have done soo far is :

def intuit_details(request):
    client = QuickBooks(
        sandbox=True,
        consumer_key=ConsumerKey,
        consumer_secret=ConsumerSecret,
        callback_url="",
        )
    authorize_url = client.get_authorize_url()
    request_token = client.request_token
    request_token_secret = client.request_token_secret
    return HttpResponse('success')

I ma stuck at what will be my call back url and does it needed to be a method that i need to define and do the furthur work. i have been stuck to it for 4 days. When i put localhost in call back url it return me the value/tokens/keys but i guess that is wrong way to do it.

if anyone can point me i right direction or help me understand what i need to do . TIA

Upvotes: 0

Views: 75

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27952

The OAuth callback URL is a URL that you create, which receives the OAuth tokens that Intuit provides to you.

Basically, once the user authorizes access via the Intuit-supplied UI, Intuit redirects them back to your callback URL (again, a URL you create and specify) with the OAuth access tokens appended to the end of it as a query string.

You then store the OAuth credentials, and use them in future REST API requests.

Read all about it in the spec:

And in Intuit's documentation:

Here's a copy/paste of Intuit's documentation on the subject:

Handling the response

The Intuit OAuth service verifies the signature and consumer key sent in the request. If successful, it returns the access token tuple to the oauth_callback parameter that you specified in the request. A successful response to the request contains the following fields:

Field | Description

oauth_token_secret | The access token secret.

oauth_token | The access token.

All response fields are returned as query parameters, as shown below:

https://www.mydemoapp.com/oauth-redirect?
oauth_token_secret=[system generated access token secret]&
oauth_token=[system generated access token]

In persistent storage, save the OAuth oauth_token, oauth_token_secret, and realmId, associating them with the user who is currently authorizing access. Your app needs these values for subsequent requests to the Quickbooks API. Be sure to encrypt the access token and access token secret before saving them in persistent storage.

Upvotes: 1

Related Questions