netsuite-oauth-sha256

1.1.3 • Public • Published

netsuite-oauth-sha256

This auxiliary module abstracts the authentication mechanism used by NetSuite Restlets.

Example of GET request

const NetSuiteOauth = require('netsuite-oauth-sha256');
 
const url = 'your-restlet-url';
const method = 'GET';
const consumerKey = 'your-consumer-key';
const consumerSecret = 'your-consumer-secret';
const tokenId = 'token-id';
const tokenSecret = 'token-secret';
const account = 'account Id';
 
const oauth = new NetSuiteOauth(url, method, consumerKey, consumerSecret, tokenId, tokenSecret, account);
 
oauth.get().then(response => console.log(response));

Example of POST request

const NetSuiteOauth = require('netsuite-oauth-sha256');
 
const url = 'your-restlet-url';
const method = 'POST';
const consumerKey = 'your-consumer-key';
const consumerSecret = 'your-consumer-secret';
const tokenId = 'token-id';
const tokenSecret = 'token-secret';
const account = 'account Id';
 
const oauth = new NetSuiteOauth(url, method, consumerKey, consumerSecret, tokenId, tokenSecret, account);
const data = {key: 'value'};
 
oauth.post(data).then(response => console.log(response));

Package Sidebar

Install

npm i netsuite-oauth-sha256

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

5.14 kB

Total Files

3

Last publish

Collaborators

  • dima-duka