Has anyone been able to use Excel Power Query to connect to NetSuite REST API using either OAUTH 1.0 or 2.0? I am able to connect and run using Postman and Python, but when I try the same with Power Query, it errors out with Access to the resource is forbidden. I know all the settings are correct since they were copied from NetSuite and work in Python and Postman.
Any working code or help with the code below will be very much appreciated. FYI - using Analytics Connect (ODBC) or Report query or external options like CData or Celigo are out of scope partly because the data I need can not be added as a report and the other options are too expensive.
Here are things I have tried:
- Copied the working authorization header from Postman into Power Query editor - get same forbidden error
- Copied the non-working header from Power query into Postman - now Postman also errors out
- Checked login audit trail in NetSuite - all failures show Invalidtimestamp
- Verified timestamp to make sure it is correct
- I think it is related to the signature since Invalidtimestamp also shows when signature is not acceptable.
- In Power query, I use the https://cdnjs.com/libraries/crypto-js webpage to get signature
- Thanks to davidebacci - used the first solution in HMAC SHA256 function for PowerQuery