Can anyone please advise me on how to access my QuickBooks Online account programmatically, specifically from a Java application using the QBO Java library.
For example:
OAuthAuthorizer oauth = new OAuthAuthorizer(
consumerKey, consumerSecret,
accessToken, accessTokenSecret);
Context context = new Context(
oauth, appToken, ServiceType.QBO, realmID);
DataService qbService = new DataService(context);
I'm not trying to create an application that others can use to log into their QB accounts. I just want programmatic access to my own account. Do I really have to create oAuth token and secret just for that (and keep renewing the tokens)? And if so, how do I do that?
When I try using the oAuth playground for my account (to generate oAuth tokens), the popup dialog that appears asks me "Which company would you like to connect to?" but the only option is a sandbox (dummy) company account, not my real account.
I was able to do this a couple of years ago (as in, the playground would list the correct account to connect to), but now I don't know how to get it working.
You can still use the playground to generate Oauth Access Tokens if you do not write code to do the Oauth handshake. The tokens are only valid for a max of 6 months before they need to be refreshed.
https://appcenter.intuit.com/Playground/OAuth/IA/
Secondly, Your development consumer key and secret allow you to access your free QuickBooks Online Sandbox, while your production consumer key and secret allow you to access your production QuickBooks Online Account.
Feel free to use the playground to generate access tokens, but you have to do it every 6 months. Simpler to implement the Oauth login and handshake in your code and re-login or call refresh as needed.
-Jarred