IntuitDeveloper / SampleApp-CRUD-.Net

CRUD sample for V3 DotNet SDK using OAuth1
13 stars 29 forks source link

Support for Asp.Net Core 2.0 applications #12

Closed a-patel closed 7 years ago

nimisha84 commented 7 years ago

Unfortunately we do not have support for .Net core in the SDK and it is not in plan very soon. If you can help us with the details of what specific use case you have for using .Net core, it will help us prioritize this request.

a-patel commented 7 years ago

Thanks for your quick reply.

I am using the web application which is written in asp.net core 2.0 (currently it is in progress). I need to integrate QuickBook API (e.g. account, invoice) in it. I need it urgently.

a-patel commented 7 years ago

I also need to use QuickBook api in windows service.

nimisha84 commented 7 years ago

Thanks for your feedback, will pass it to the team to see if .Net core is something we can support sooner but right now we don't support it. For windows service please see these details - Do you have an OAuth 1.0a app that has consumer key and secret or do you have an app that was created recently for OAuth 2.0 and has client id and client secret? Note that only new developer accounts having no previous apps can have an OAuth 2.0 app. See information here for more about OAuth 1.0a and OAuth 2.0 apps: https://developer.intuit.com/docs?redirectid=Oauth2VsOAuth1

For OAuth 2.0 apps Referto this documentation:

-Docs: https://developer.intuit.com/docs?redirectid=AppOAuth

-Sample apps: https://developer.intuit.com/docs?redirectid=QBO_SampleApps or directly go to https://github.com/IntuitDeveloper

-SDKs: https://developer.intuit.com/docs?redirectid=QBO_SDKs

Oauth2 playground- https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0012_api_explorer

Postman- https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0012_postman

For desktop apps and automated service type apps for Oauth2

There is no way to bypass the Oauth process. You will have to do it at least once to make api calls. So, if you have a desktop app/service then you can use Postman or Oauth2 playground we have, add the app keys and then get the Oauth2 tokens. Hardcode them in your application. Then keep on refreshing access token using refreshtoken api call until refresh token expires in 100 days. Then again get new access tokens by playground or postman and repeat api calls until refresh token expires. This would be a cycle of hardcoding tokens every 100 days. Always save the latest refresh token in your code as once used refresh tokens can expire in 24hrs.

OAuth2 playground-https://developer.intuit.com/v2/ui#/playground

On the developer.intuit.com->Your app tab->Keys->Add this redirect url under your Prod app keys->Redirect url-https://developer.intuit.com/v2/OAuth2Playground/RedirectUrl

Postman- https://developer.intuit.com/docs/0100_quickbooks_online/0400_tools/0012_postman

On the developer.intuit.com->Your app tab->Keys->Add this redirect url under your Prod app keys ->Redirect url-https://www.getpostman.com/oauth2/callback

For OAuth 1.0a apps For SAAS Apps, refer the steps below for Oauth integration with QuickBooks Online APIs. For desktop apps, either you need to have a web component or a receiver configured for OAuth 1.0a callback handling or use hard coded tokens. Refer to bold section below.

Steps for integration with QuickBooks Online APIs- Please use sandbox QuickBooks accounts on developer.intuit.com for testing or development.

Please refer the following blog post for integrating with the QuickBooks Online API-https://developer.intuit.com/blog/2015/04/16/a-3-step-guide-to-getting-started-with-intuit-developer https://developer.intuit.com/hub/blog/2016/04/25/quick-start-to-quickbooks-online-rest-api-with-oauth1-0 Status page for APIs: https://intuitdevelopergroup.statuspage.io/

Go to https://developer.intuit.com/. Create an app on the Intuit Developer platform for the QuickBooks Online v3 apis. You get a consumer key, consumer secret, and app token, which you set in the config of your code.

Implement Connect to Quickbooks button: https://developer.intuit.com/docs?redirectid=OAuth1.0a

Run the code. Your client that has the QuickBooks Online company can then authorize your code/website to access his company data using the Connect to Quickbooks button. During development you can authorize the code to access your sandbox company. NOTE: For sandbox testing, you need to use development app keys and sandbox base URL. For live/production QuickBooks company testing, use production app keys and production base url.

Alternatively, to connect to a production QuickBooks company, you can generate the OAuth access tokens from the OAuth playground. Go to your app->Click Test Connect to Oauth->Intuit Anywhere tab->Set time duration in seconds for 180 days and get the access token and secret for your app and company by right clicking on the page and doing a view source.

Then, you set the access token, access token secret, and realmid/companyid to make api calls for their QuickBooks API company, which is valid for 180 days. To renew tokens, you can call reconnect api after 150 days or do Connect to Quickbooks after 180 days to get new tokens. https://developer.intuit.com/docs?redirectid=OAuthAPI

For desktop apps and automated service type apps for Oauth1

There is no way to bypass the Oauth process. You will have to do it at least once to make api calls. So, if you have a desktop app/service then you can use Postman or any sample apps we have, add the app keys and then get the Oauth tokens.These are valid for 180 days. Then use app keys and OAuth tokens in your code.

If you have further questions on the .Net SDK or apis, please ask on developer.intuit.com->Help.