Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

...

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document


  • Min:0
  • Max:1
  • Mapper Snap
  • Copy Snap
An HTTP request.
Output

Document 

  • Min:1
  • Max:1
  • Mapper Snap

An HTTP response.

...

Parameter NameData TypeDescriptionDefault ValueExample 
LabelString
Required. The name for the Snap. You can modify the default name to be more specific and meaningful, especially if you have more than one of the same Snaps in your Pipeline.
NetSuite Call RESTletRESTlet GET
HTTP MethodDrop-down list

Required. 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 a HTTP request.
  • PUT: The PUT method sends data to a server to create or update a resource.
GETPOST
Script IDString/Integer

Required. Specify the ID of the RESTlet script.

Info

You should create and configure the RESTlet script in the NetSuite UI.


N/Acustomscript8
8
Deploy IDString/IntegerRequired. Specify the ID of the RESTlet deployment.N/Acustomdeploy2
2
ContentString/Suggestion

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.

$$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.


KeyString/ExpressionEnter the parameter key.N/ACity
ValueString/ExpressionEnter the parameter value for the corresponding key.N/AHyderabad
Has NextString/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 Decorator.


N/AparseInt($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 TypeDrop-down 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.


application/jsonapplication/xml
Maximum request attemptsInteger/ExpressionSpecify the maximum number of requests to attempt in case of failure.34
Retry request intervalInteger/ExpressionSpecify the interval between two successive requestsA retry happens only when the previous attempt resulted in an exception.23
Snap ExecutionDrop-down list

Select one of the three modes in which the Snap executes:

  • 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 the Snaps that are downstream from it.

Validate & ExecuteExecute only

...

Multiexcerpt include macro
macro_uuid328373cd-d841-45bf-b982-72dd5da6fa48
nameNetsuite_Troubleshooting
templateDataeJyLjgUAARUAuQ==
pageNetSuite Async Get List
addpanelfalse

Examples

Calling a RESTlet Using the GET method

The following example Pipeline demonstrates how you can call a customscriptecho RESTlet using the GET method and query parameters. We use the Mapper and NetSuite Call RESTlet Snaps in this example.
Image Modified

First, we configure the Mapper Snap to pass inputs to the NetSuite Call RESTlet Snap as follows.
Image Modified

Then, we configure the NetSuite Call RESTlet Snap to perform a GET operation and get the desired response in the body.
Image Modified

Upon validation, the output displays the response as follows.
Image Modified

Download this Pipeline.

Calling a RESTlet Using the POST method

The following example Pipeline demonstrates how you can execute a POST request using the POST method. We use the JSON Generator and NetSuite Call RESTlet Snaps in this example.
Image Modified

Snap ConfigurationSnap Output

First, we configure the JSON Generator Snap to pass inputs to the NetSuite Call RESTlet Snap.

Then, we configure the NetSuite Call RESTlet Snap to perform a POST operation. Note that the Content field is activated by default for the POST method to pass the response as a body. We set the Content field to $update to select a subset of the input document.
Image Modified

Upon validation, the output document includes the subset of objects for request, information, response and original.
Image Modified

Download this Pipeline.

Creating a RESTlet using the GET method to perform multiple GET requests to retrieve five pages

...