@marturion/suitetalk
v1.0.0
Published
A small helper library for assising communication with Netsuite Rest Web Services
Downloads
4
Readme
marturion-suitetalk-01 / Exports / NetsuiteRest
Class: NetsuiteRest
Netsuite Rest Client
description
Helps facilitate communications with Netsuite Suitetalk Web Services
const netsuiteRestOptions: INetsuiteRestOptions = {
// Populate with Authentication Keys
}
// Setup Netsuite Rest Client
const NetsuiteClient: NetsuiteRest = new NetsuiteRest(netsuiteRestOptions)
// Setup request options
const netsuiteRequestOptions: INetsuiteRequestOptions = {
path: 'query/v1/suiteql',
method: "POST",
body: JSON.stringify(requestBody),
}
// Perform the request
NetsuiteClient.Request(netsuiteRequestOptions);
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new NetsuiteRest(options
)
Netsuite Rest Contructor
argument
INetsuiteRestOptions
Parameters
| Name | Type |
| :------ | :------ |
| options
| INetsuiteRestOptions
|
Defined in
Properties
algorithm
• Private
algorithm: string
= "HMAC-SHA256"
Algorithm to be used for Hashing Functionality
Defined in
baseUrl
• Private
baseUrl: string
Netsuite URL to override realm, If passing a baseURL the realm is still needed for authentication
Defined in
consumerKey
• Private
consumerKey: string
Netsuite integration record consumer key
see
Integration Record Oracle Docs
Defined in
consumerSecret
• Private
consumerSecret: string
Netsuite integration record consumer secret key
see
Integration Record Oracle Docs
Defined in
realm
• Private
realm: string
Netsuite account id
// if production
XXXXXX - a number of 6 digits or more
// if Sandbox
XXXXXX_SB or XXXXXX_SB1
Defined in
token
• Private
token: string
Netsuite user access token for token based authentication
see
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4254975694.html
Defined in
tokenSecret
• Private
tokenSecret: string
Netsuite user access secret for token based authentication
Defined in
Methods
Request
▸ Request(options
): Promise
<AxiosResponse
<any
, any
>>
Perform a Request to Netsuite Rest Web Services Also supports using suiteQL for requests
example
// Setup Netsuite Client
const NetsuiteClient: NetsuiteRest = new NetsuiteRest(netsuiteRestOptions);
// Setup request options
const netsuiteRequestOptions: INetsuiteRequestOptions = {
path: 'query/v1/suiteql',
method: "POST",
body: JSON.stringify(requestBody),
}
// Peform Request
NetsuiteClient.Request(netsuiteRequestOptions);
Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| options
| INetsuiteRequestOptions
| INetsuiteRequestOptions |
Returns
Promise
<AxiosResponse
<any
, any
>>