NetSuite Call RESTlet

Overview

The NetSuite Call RESTlet Snap calls RESTlet scripts using token-based authentication.

This Snap provides the functionality of the NetSuite RESTlet framework that supports the HTTP methods (GET, DELETE, POST, PUT) and MIME types. You can use any existing NetSuite Token Account for this Snap without making any modifications to the account.

Note: The UI settings for this Snap rely on features that work only with the New Form UI, such as dynamic activation of fields and the use of expressions for Boolean fields.


Prerequisites

  • A valid client ID.
  • A valid NetSuite account with the required permissions.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has at most one document input view.

An HTTP request.

Output

This Snap has exactly one document output view.

An HTTP response.

Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label

String

Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: NetSuite Call RESTlet

Example: RESTlet GET

HTTP Method*

Dropdown list
Select the HTTP method to call the RESTlet. The available options are:
  • GET: The GET method requests data from a specified resource.
  • DELETE: The DELETE method deletes the specified resource.
  • POST: The POST method sends data to a server to create or update a resource. The data that is sent to the server using the POST method is stored in the request body of an HTTP request.
  • PUT: The PUT method sends data to a server to create or update a resource.

Default value: GET

Example: POST

Script ID*

String
Specify the ID of the RESTlet script.
Note: You should create and configure the RESTlet script in the NetSuite UI.

Default value: N/A

Example: customscript8

Deploy ID*

String
Specify the ID of the RESTlet deployment.

Default value: N/A

Example: customdeploy2

Content

String
Activates when you select POST or PUT for HTTP Method. Specify the path of the content for the body of a POST or PUT request.

Default value: $

Example: $update

Query Parameters Activates when you select GET or DELETE for HTTP Method. Use this field set to add query parameters to the request URL. This field set contains the following fields: Key, Value.
Note: Query parameters are not supported for POST and PUT methods.
Key

String/Expression
Enter the parameter key.

Default value: N/A

Example: City

Value

String/Expression
Enter the parameter value for the corresponding key.

Default value: N/A

Example: Hyderabad

Has Next

String/Expression
Specify the expression that must be evaluated to true or false on the output document to determine whether more results are available. If the expression evaluates to true, the query parameters for the next request are updated using the values provided in the Query Parameters for Next field.
Warning: Do not disable the Expression enabler.

Default value: N/A

Example: parseInt($response.content.page) < 5

Query Parameters for Next Activates when you provide an expression for Has Next. Use this field set to add query parameters to the request URL. This field set contains the following fields: Key, Value.
Note: When the expression in Has Next evaluates to true, the entries in this field set override the entries in the Query Parameters field set before making a request for the next page. Each value's expression is evaluated against the current output document.
MIME Type

Dropdown list
Choose the MIME type for the content-type header of the request and response. The available options are:
  • application/json
  • application/xml
  • text/plain
Note: XML MIME type is supported only for the GET method.

Default value: application/json

Example: application/xml

Maximum request attempts

Integer/Expression
Specify the maximum number of requests to attempt in case of failure.

Default value: 3

Example: 4

Retry request interval

Integer/Expression
Specify the interval between two successive requests. A retry happens only when the previous attempt resulted in an exception.

Default value: 2

Example: 3

Snap execution

Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute. Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only. Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled. Disables the Snap and all Snaps that are downstream from it.

Troubleshooting

Error Cause Resolution
HTTP/1.1 407 Proxy Authentication required. Unable to tunnel through proxy. Add the following key-value pair values to your Groundplex configuration and restart the plex to reflect the changes: Key: jcc.jvm_options, Value: -Djdk.http.auth.tunneling.disabledSchemes=""