Forum Discussion
CharlieMurawski
8 years agoQrew Cadet
Hi Stephanie,
I did a little bit of research on the Quick Books Online API and they have a pretty standard oAuth flow for obtaining access to their API (see attached image). Unfortunately I don't think this is achievable (at least in a very secure way) via a single webhook.
Please use this as a reference on the below: https://developer.intuit.com/docs/00_quickbooks_online/2_build/00_build
As you see in the image in order to make the actual API call to create an Invoice; you need to do the following:
1) Send a request (GET) using your client key/redirect URI of the app you set up in Quick Books developer
Request:
Response: https://www.mydemoapp.com/oauth-redirect?state=security_token%3D138r5719ru3e1%26url
%3Dhttps://www.mydemoapp.com/oauth-redirect&code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7&realmId=1231434...
2) Take the Authorization Code from the response and make a request for an access token:
Request:
Response:
3) You can then use that access token to make API Calls (like your invoice webhook here). You'll notice that it expires in 3600 seconds (1 hour) and you can use the refresh token to generate a new access token for future API Calls -- this is a pretty standard security measure.
So in summary this cannot be achieved via a single webhook without performing a few authentication steps with Quickbooks
Since you need to be able to make a few requests prior to your create invoice, I would suggest the following as options:
1) Use Workato/Zapier's http connectors; you could achieve this easily. Basically your webhook would call your integration recipe, perfrom steps 1-2, and then create your invoice.
I'd imagine those products have ways to authenticate to Qbooks without these steps (using their connectors), just by plugging in your credentials, so maybe even no need for writing http posts!
2) Use a tool like Postman to generate your tokens and plug into your quick base webhook.
Not ideal because you'd have to generate a new one every hour and put in your webhook; although they can be updated with the API so you could create a flow in Postman that can do all these steps with a button click.
https://help.quickbase.com/api-guide/index.html#api_webhooks_edit.html
I hope that was helpful, let me know if you have any questions-- I know that was a lot, but I love learning new APIs :)
I did a little bit of research on the Quick Books Online API and they have a pretty standard oAuth flow for obtaining access to their API (see attached image). Unfortunately I don't think this is achievable (at least in a very secure way) via a single webhook.
Please use this as a reference on the below: https://developer.intuit.com/docs/00_quickbooks_online/2_build/00_build
As you see in the image in order to make the actual API call to create an Invoice; you need to do the following:
1) Send a request (GET) using your client key/redirect URI of the app you set up in Quick Books developer
Request:
GET https://appcenter.intuit.com/connect/oauth2?state=security_token%3D138r5719ru3e1%26url%3Dhttps://www.mydemoapp.com/oauth-redirect&;
client_id=Q3ylJatCvnkYqVKLmkH1zWlNzNWB5CkYB36b5mws7HkKUEv9aI& response_type=code& scope=com.intuit.quickbooks.accounting& redirect_uri=https://www.mydemoapp.com/oauth-redirect&
Response: https://www.mydemoapp.com/oauth-redirect?state=security_token%3D138r5719ru3e1%26url
%3Dhttps://www.mydemoapp.com/oauth-redirect&code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7&realmId=1231434...
2) Take the Authorization Code from the response and make a request for an access token:
Request:
POST https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer HTTP/1.1 Accept: application/json Authorization: Basic UTM0dVBvRDIwanp2OUdxNXE1dmlMemppcTlwM1d2 NzRUdDNReGkwZVNTTDhFRWwxb0g6VEh0WEJlR3dheEtZSlVNaFhzeGxma1l XaFg3ZlFlRzFtN2szTFRwbw== Content-Type: application/x-www-form-urlencoded Host: oauth.platform.intuit.com Body: grant_type=authorization_code& code=L3114709614564VSU8JSEiPkXx1xhV8D9mv4xbv6sZJycibMUI&redirect_uri=https://www.mydemoapp.com/oauth-redirect
Response:
{ "token_type": "bearer", "expires_in": 3600, "refresh_token":"L311478109728uVoOkDSUCl4s8FDRvjHR6kUKz0RHe3WtZQuBq", "x_refresh_token_expires_in":15552000, "access_token":"eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..KM1_Fezsm6BUSaqqfTedaA. dBUCZWiVmjH8CdpXeh_pmaM3kJlJkLEqJlfmavwGQDThcf94fbj9nBZkjEPLvBcQznJnEmltCIvsTGX0ue_w45h7_ yn1zBoOb-1QIYVE0E5TI9z4tMUgQNeUkD1w-X8ECVraeOEecKaqSW32Oae0yfKhDFbwQZnptbPzIDaqiduiM_q EFcbAzT-7-znVd09lE3BTpdMF9MYqWdI5wPqbP8okMI0l8aa-UVFDH9wtli80zhHb7GgI1eudqRQc0sS9zWWb I-eRcIhjcIndNUowSFCrVcYG6_kIj3uRUmIV-KjJUeXdSV9kcTAWL9UGYoMnTPQemStBd2thevPUuvKrPdz3ED ft-RVRLQYUJSJ1oA2Q213Uv4kFQJgNinYuG9co_qAE6A2YzVn6A8jCap6qGR6vWHFoLjM2TutVd6eOeYoL2bb7jl QALEpYGj4E1h3y2xZITWvnmI0CEL_dYQX6B3QTO36TDaVl9WnTaCCgAcP6bt70rFlPYbCjOxLoI6qFm5pUwGLLp 67JZ36grc58k7NIyKJ8dLJUL_Q9r1WoUvw.ZS298t_u7dSlkfajxLfO9Q"}
3) You can then use that access token to make API Calls (like your invoice webhook here). You'll notice that it expires in 3600 seconds (1 hour) and you can use the refresh token to generate a new access token for future API Calls -- this is a pretty standard security measure.
So in summary this cannot be achieved via a single webhook without performing a few authentication steps with Quickbooks
Since you need to be able to make a few requests prior to your create invoice, I would suggest the following as options:
1) Use Workato/Zapier's http connectors; you could achieve this easily. Basically your webhook would call your integration recipe, perfrom steps 1-2, and then create your invoice.
I'd imagine those products have ways to authenticate to Qbooks without these steps (using their connectors), just by plugging in your credentials, so maybe even no need for writing http posts!
2) Use a tool like Postman to generate your tokens and plug into your quick base webhook.
Not ideal because you'd have to generate a new one every hour and put in your webhook; although they can be updated with the API so you could create a flow in Postman that can do all these steps with a button click.
https://help.quickbase.com/api-guide/index.html#api_webhooks_edit.html
I hope that was helpful, let me know if you have any questions-- I know that was a lot, but I love learning new APIs :)
StephanieDevin2
8 years agoQrew Trainee
Thanks so much Charlie! I appreciate the time & advice. I would rather set it up without 3rd party tools if I can help it, but I did end up giving up eventually and using workato :)