.Net Sample App using SDK
The Intuit Developer team has written this OAuth 2.0 Sample App using .Net framework and C# to provide working examples how to use .Net SDK to make QBO API calls using tokens generated from the OAuth Playground
Table of Contents
In order to successfully run this sample app you need a few things:
- .Net framework 4.6.1
- A developer.intuit.com account
- An app on developer.intuit.com and the associated client id and client secret.
First Use Instructions
- Clone the GitHub repo to your computer
- Fill in the
Web.configfile values (clientId, clientSecret) by copying over from the keys section for your app.
- Use the Oauth playground to generate tokens and fill values accessToken, refreshToken, realmId in the
Web.configalong with valid logPath for logging.
Running the code
Once the sample app code is on your computer, you can do the following steps to run the app:
- Open the solution in Visual Studio. This app was developed and tested on VS2017.
- Put a breakpoint in Page_Load method to see the full API response.
- Run the application
The sample app demonstrates the following flows:
QBO CompanyInfo GET API - this flow shows how to make a QBO API Get request using SDK to fetch Company Information.
QBO Create Customer POST API - this flow shows how to make a QBO API Post request using SDK to create a customer.
Handle expired tokens - Both the API calls above demonstrates how to refresh the token when token expires.
Storing the tokens
This app stores all the tokens and user information in the session. For production ready app, tokens should be encrypted and stored in a database.