0

I used HTTPS module to get some response from NetSuite page, with Admin authentication. (By using NLAuth with plaintext credentials).

From 2020.2 release onwards, plaintext credentials is deprecated by NetSuite, and they suggest to use TBA or OAuth2.0.

I decided to use TBA and created an Integration and also, access tokens for Admin user.

Now, I have Consumer key, Consumer Secret, Token ID and Token Secret.

How can I make a HTTP call with these credentials. Do I need to generate oauth_signature dynamically every time?

Nitheesram Rajes
  • 138
  • 1
  • 12
  • What kind of page are you trying to get access to? If you are doing a RESTlet call then yes you generate the header each time. If so see https://stackoverflow.com/questions/50611578/netsuite-oauth-not-working/50628921#50628921 – bknights Oct 23 '20 at 04:00
  • I'm trying to get scheduled job status by calling following URLs. • /app/setup/upload/csv/uploadlogcsv.nl?wqid= • /app/setup/upload/csv/csvstatus.nl – Nitheesram Rajes Oct 23 '20 at 08:27
  • That’s not a page type supported for TBA calls. You used to be able to use the JSESSIONID from logged in session’s cookies for that sort of thing. There is an API based method for getting job statuses though. If you can’t figure it out just start another question – bknights Oct 23 '20 at 15:03

1 Answers1

0

Yes, you need to generate an oauth_signature everytime. Here are the header parameters you need, at the minimum to make it work:

enter image description here

The Authorization parameter has to be dynamically created. It has a certain structure with some mandatory parameters. It is also where you'll need the oauth_signature. Here's a sample of what the parameters and values should look like. Each parameter=value pair should be comma-separated:

  • oauth realm=""
  • oauth_consumer_key=""
  • oauth_token=""
  • oauth_signature_method="HMAC-SHA256"
  • oauth_timestamp=""
  • oauth_nonce=""
  • oauth_version="1.0"
  • oauth_signature=""

You can search sample source codes for generating the dynamic values. The user access tokens/integration credentials you have would come in handy. Hope this helps anyone.

nadinnnnnne
  • 509
  • 4
  • 4