Roger
Roger

Reputation: 573

quickbooks apis without a browser

Primary question:

Is there any (supported/non-hacky) way to use Quickbooks Online and Customer Account Data APIs without involving a browser at all, i.e. making an API request from a server?

Commentary:

The IPP docs only mention saml and 3-legged oauth, which seems to imply that any authentication and subsequent api calls must come from a browser.

Note that this is not satisfactorily answered by this:

How can I use API to get quickbooks data without browser based OAUTH?

, as that answer:

  1. is not by Intuit and does not point to an Intuit source
  2. suggests a hacky solution: a user/browser authenticates, after which the oauth/etc. credentials are stored and reused. This seems like a particularly bad idea for long-term use unless explicitly approved by Intuit, due to the fact that the apis may (and probably will) expire any oauth/saml tokens at some point.

Upvotes: 1

Views: 274

Answers (1)

Manas Mukherjee
Manas Mukherjee

Reputation: 5340

No, to get accessToken and accessSecret you need to use a browser.

As you have mentioned, your 2nd option is the only way to achieve this. i.e reusing stored tokens.

PN - OAuth tokens are valid for 180 days. Before the token expires, your app can obtain a new token to provide uninterrupted service by calling the Reconnect API. You can automate this part by writing a small program which will call ReconnectAPI when tokens are older than 150 days.

Ref - Manage OAuth Tokens

You can generate OAuth tokens(for the very first time) from here - IPP OAuth Playground

CAD Here, OAuth tokens are valid for 1 hour. After an hour, your application will have to issue another SAML assertion again to request a new OAuth token to use. The token should only be persisted during your user's session, and then destroyed.

Ref - CAD SAML

Thanks

Upvotes: 2

Related Questions