REST Get [Not Recommended]
In this article
- 1 Overview
- 2 Snap Settings
- 3 Troubleshooting
- 4 Examples
- 4.1 Retrieving Contact Information from HubSpot
- 4.2 Retrieving Contact Information from HubSpot Using Upstream Values
- 4.3 Connecting to the SnapLogic API
- 4.4 Connecting to Rally with REST
- 4.5 REST Get Pagination: Eloqua
- 4.6 REST Get Pagination: Marketo
- 4.7 REST Get handles multiple response cookies
- 4.8 Example Output to demonstrate when Process Array is Deselected
- 4.9 Example Output to demonstrate when Process Array is Selected
- 4.10 Downloads
Overview
You can use the REST Get Snap to execute an HTTP Get method on a REST API service endpoint.
Prerequisites
None.
Supported Features
Works in Ultra Tasks.
Limitations and Known Issues
The REST GET Snap Link HTTP response header maybe be malformed compared to other third-party applications like POSTMAN.
Snap Views
View Type | View Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Document |
|
| Each input document offers details associated with the data required from the target RESTful server. |
Output | Document |
|
| Each output document contains data retrieved from the RESTful web server. If the Snap fails during the operation, it sends an error document to the error view containing the fields error, reason, resolution, and stacktrace. However, you must enable the Error view to view the error document. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. | |||
Snap Settings
Field Name | Field Type | Description |
|---|---|---|
Label*
| String | Specify a unique name for the Snap.
|
Service URL*
Default Value: N/A | String/Expression | Specify the service endpoint URL of REST API. You can provide the URL in one of the following ways:
For example:
For example: For Snaps using AWS Signature V4 accounts, you can use the canonical name (CNAME) for the URI so it's not necessary for the URL to end with amazonaws.com or have the region and service provided in it. However, if you are using the CNAME you must provide it in the AWS Region and Service Name fields in the AWS Signature V4 account. The host name in the CNAME must be equal to the bucket name. For example: New URI with CNAME: Here, the bucket name is The Snap finds the value at the JSON path $.widget.id in the input data and replaces "%s" in the Service URL with the value. You can connect File Reader and JSON Parser Snaps upstream of a REST Put Snap and prepare the following JSON file for the File Reader Snap:
The Service URL for a REST snap must be valid. If the Service URL contains any special characters, such as !, =, %21, $, and ^, the Snap throws an exception error. You can escape the special characters (using expression language) with one of the following methods:
For example:
For example (where
We recommend that you use the |
Process array
Default Value: Deselected | Checkbox | Select to produce a stream of documents with one record in each document.
|
Trust all certificates
Default Value: Deselected | Checkbox | |
Follow redirects
| Checkbox | |
Query parameters
Default Value: N/A |
| |
Query parameter
Default Value: N/A | String | The name of the query parameter.
|
Query parameter value
Default Value: N/A | String/Expression | The value that you want to assign to the parameter. |
HTTP Header | ||
Key
Default Value: N/A | String/Expression | The name of the HTTP header. |
Value
Default Value: N/A | String/Expression | The value that you want to assign to the HTTP header. |
Response entity type
Default Value: DEFAULT | Dropdown list | Select one of the following response entity types you want the Snap to display in the output document.:
If you select TEXT or BINARY, the Snap does not parse the entity content. If you select DEFAULT, the Snap produces the expected result in most cases, but if it fails to process as expected, you can set the Response entity type to TEXT or BINARY. |
Cookie Policy
Default Value: Ignore Cookies | Dropdown list | Select a Cookie Policy from the following options:
|
Read timeout
Default Value: 900 | Integer | |
Connection timeout
Default Value: 30 | Integer |
|
Maximum request attempts
Default Value: 5 | Integer |
|
Retry request interval
Default Value: 3 | Integer | Specify the time in seconds to wait before retrying the request. |
Retry Policy
Default Value: Connection errors | String | Select how you want to handle connection and error responses from the following options:
|
Normalize URL | Checkbox |
|
Has next
Default Value: N/A | String/Expression | Enter the expression that must be evaluated on the output document to true or false, to indicate whether there are more records available. The Snap continues to read the next page until this expression evaluates to false in the new set of output documents. Has next is a property in the API response that indicates whether there are more records to be fetched. This property is used for the REST Get pagination feature, which retrieves 20 records at a time (referred to as a page), by default. Learn more about REST Get#RESTGetPagination. To see this property in action, see Retrieving Contact Information from HubSpot or Retrieving Contact Information from HubSpot Using Upstream Values, below. This field is null-safe; if the evaluated value is null, or if there is no value provided in Has next field, the Snap stops the pagination. |
Next URL
Default Value: N/A | String/Expression | Enter the expression that is evaluated on the output document to a URL that the Snap must use to get the next page. This property is used for the REST Get pagination feature. The Next URL has two components, which are structured as follows:
You can create the Next URL in either of the following ways:
For additional information, see Retrieving Contact Information from HubSpot or Retrieving Contact Information from HubSpot Using Upstream Values. The Next URL is evaluated as an expression but not encoded, which is the general behavior of the Snap. |
Pagination interval(s)
Default Value: 0 | Integer | The number of seconds for the Snap to wait before attempting to get the next page.
|
Show all headers
Default Value: Deselected | Checkbox | |
Snap Execution
Default Value: Validate & Execute | String | Select one of the following three modes in which the Snap executes:
|
REST Get Pagination
When making REST API calls to a specific endpoint using the GET method, there might be a lot of results to return. We use the pagination settings to fetch all the records/documents on multiple pages. For example, if the GET API call returns 20 documents by default, to get all other pages/records, we use Has Next field and get the list of all records until the last record.
Using REST Get to Process gzip Compressed Data
The response can provide gzipped data. In that case, the Snap can be configured to process it using the header parameter:
HTTP Header
Key | Value |
|---|---|
Accept-Encoding | gzip |
Accept | */* |
The stream is then uncompressed while parsing the data and making it available on the output view.
Troubleshooting
Error | Reason | Resolution |
|---|---|---|
Failed to execute HTTP request. | The Service URL must have a protocol, such as http://, https://. | Check the Snap properties. Specifically, check your entry in the Service URL field. |
<Service_URL>: Name or service not known. This basically means that the service URL you entered is not accessible. | ||
Failure: Validation errors: property_map.settings.serviceUrl.value: Could not compile expression: <Service_URL> | The snap settings are not correct. Encountered extraneous input ':' at line 1:5; expecting={<EOF>, '||', '&&', '^', '==', '!=', '>', '<', '>=', '<=', '+', '-', '*', '/', '%', '?', 'instanceof', 'in', 'matches', '[', '(', '.', PropertyRef}. This means that you have turned expressions on () while entering string value into the Service URL field. | Fix the snap configuration and try executing again. Please check expression syntax. Ensure that your service URL is a proper expression; or turn off the expression control (). |
URL Parse Exception - 403 | The Service URL path might be containing any of the following special characters: | To escape the special characters, use the global function encodeURIComponent on any variables that might contain special characters so that they are encoded properly. |
Too many Requests - 429 | There are too many requests to REST endpoint. | Wait for the retry to succeed. Rest related Snaps extract the response header and automatically retry when they encounter status 429. By default, the retry interval (Retry-After) is specified in the HTTP response header. If no value is available for Retry-After, then the Snap’s Retry Interval value is used. |
Examples
Retrieving Contact Information from HubSpot
In this example, we use the Has next field to retrieve the list of users created most recently in HubSpot, then separate the user information from the other details in the API response.
Step 1: Configure the REST Get Snap to retrieve user information from HubSpot. Configure the REST Get Snap without the Pagination details - Has Next and Next URL.
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.