Question

Is it possible to implement Oauth2 flow in Javascript code added in ZAP and get access token to call APIs?

  • 9 June 2023
  • 7 replies
  • 155 views

I need to create Zapier ZAP and call Quicbooks Online API to create Employee using Javascript code as Quickbooks Zapier App for Quickbooks does has Action for it. Quickbooks uses Oauth2 authentication. Is there any way available to implement Oauth2 flow in Javascript code in Zapier, so access token can be received from Quickbooks and API can be called?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 7
Badge +14

Hi @pankajkanungo 

Good question.

Try using one of these QBO actions that handle authentication automatically.

 

Hello Troy Tessalone ,

 

Thanks for replying.

 

I have looked for these options available in Zapier App for Quickbooks but requirement is something like data needs to be processed before creating data in QBO resource.

For example recently got a requirement where Invoices created in a month needs to be fetched from QBO using API then separate Bills needs to be created using Invoice Line items for each Vendor.

So to fulfill requirement Java script code needs to be added in Zapier ZAP and that is why Oauth2 flow needs to be added to get access token and call QBO APIs.

Please suggest how Oauth2 flow can be implemented in Javascript code added in ZAP?

Userlevel 7
Badge +14

@pankajkanungo 

You can configure the Zap steps like this…

  1. Trigger: Schedule
  2. Action: QBO - API Request
  3. Action: Code (JavaScript)
  4. Action: Looping
  5. Action: QBO - Create Bill

@Troy Tessalone 

Thanks for replying and for giving time for it.

My case is suppose there are 10 Invoices created for a month and Bill for each Vendor needs to be created in QBO. Invoice items may be associated to different Vendors. So for each Vendor 1 Bill needs to be created. So to prepare data  to create Bill for each Vendor, JS code needs to be write.

There are many such situations exists when JS code needs to be write for system which uses Oauth2 flow.

So requirement is know how to implement Oauth2 flow in JS Code. 

Userlevel 7
Badge +14

@pankajkanungo 

You can use the QBO Zap app actions to interact with the QBO API to fetch (GET) data, then use a Code step to handle the data as you need with JavaScript, followed by a QBO Zap app action to interact with the QBO API (POST, PUT, PATCH).

I need to create Zapier ZAP and call Quicbooks Online API to create Employee using Javascript code as Quickbooks Zapier App for Quickbooks does has Action for it. Quickbooks uses Oauth2 authentication. Is there any way dmv foam available to implement Oauth2 flow in Javascript code in Zapier, so access token can be received from Quickbooks and API can be called?

I'm currently working on integrating QuickBooks Online API with Zapier to create an employee. However, the QuickBooks Zapier App does not have a specific action for this purpose. To overcome this limitation, I'm considering implementing the OAuth2 flow in JavaScript code within Zapier.

My goal is to receive an access token from QuickBooks through the OAuth2 authentication process and use that token to make API calls. 

Userlevel 7
Badge +14

@ndrixJax 

Try using this Zap action: QBO - API Request