Question

Building a Custom Connector to Netsuite: Netsuite wants 24+ length "state" param yet Zapier's is 23

  • 26 March 2023
  • 6 replies
  • 144 views

Userlevel 2

I’m trying to build a custom OAuth2 Integration with Netsuite using the developer console.

Netsuite’s documentation requires a “state” parameter in the OAuth urls that is between 24 and 1024 characters long.

Zapier’s state parameter is… 23 characters long 🤦

Is there anyone who has successfully integrated with Netsuite who may have encountered this? I was hoping there’d be a way to override Zapier’s state param but I’m not seeing a way. Otherwise, is there perhaps another known way to do the integration (please don’t tell me I have to build a custom OAuth1 app).


6 replies

Userlevel 2

Oh here is the Netsuite documentation. I’ve checked my audit logs in NS to confirm that I’m getting an “InvalidState” error which is what sent me down this rabbit hole. 

Per the Netsuite documentation on OAuth2, the state must be 24-1024 characters https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/subsect_158711892221.html

For reference, here’s where I am in the developer platform. To try and hack a workaround around this error I created a “randomNumber” formula to generate my own “state” param for the Step 1 Auth URL (see image at bottom). However, Zapier tells me that I’m not allowed to do that when I attempt to run the auth flow at the bottom of the zapier platform page.


 

Userlevel 2

Forget it. I went and built a private custom OAuth1 integration for Netsuite.  If there’s any interest from the community in obtaining such an integration, feel free to let me know in this thread. I’d consider petitioning my org to open-source the code if I were getting some outside interest.

Userlevel 2
Badge +1

Hi @AJM, great that you made it work.

 

We are building a Netsuite connector too. 

 

It will include most of the triggers and actions the endpoints available on the API.

@AJM I am interested if it’s something you can share. it’d be much appreciated.

Userlevel 2

@ben_waa I’ll see if I can petition my org to open source the code. I’ll have to do some work on my end to remove the proprietary/sensitive stuff 😄

@AJM We are also looking to build an integration for Netsuite and Zapier. We just moved to Netsuite a few weeks ago and are really wishing Zapier already had something! If your company is open to making it open source, we would 100% be interested in checking it out.

Reply