Skip to end of banner
Go to start of banner

REST Delete

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 44 Next »

In this article

Overview

You can use the REST Delete Snap to delete business object resources using a REST API call.

Prerequisites

None.

Supported Features

Works in Ultra Task Pipelines. We recommend you to set the batch size to 1.

Limitations and Known Issues

None.

Snap Input and Output

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input Document
  • Min: 0
  • Max: 1
  • REST Get
  • Mapper
  • Script
Each input document contains the ID of the object to be deleted at the REST API service endpoint.
OutputDocument
  • Min: 0
  • Max: 1
  • REST Post
  • JSON Formatter
  • Mapper

Each output document contains response data from the REST API service endpoint detailing the status of the request.

Snap Settings

Field NameField TypeDescription
Label*String

Specify a name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Default Value: REST Delete
ExampleREST Delete

Service URL*

String/Expression

The excerpt 'REST_Serviceurl' was not found in the space 'SD' or you may not have the necessary permissions to access it.

The Service URL for the REST snap has to 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) using one of the following methods:

We recommend you to use the former (encodeURIComponent) method to escape the special characters.

Default Value: N/A
Examplehttps://www.example.com/slm/webservice/v2.0/defect/%s".replace("%s", $.widget.id)

HTTP entityString/Expression

Specify the JSON path to the HTTP entity data in the input map data. You can leave this field blank if there is no entity data to send to the service URL.

Default Value: N/A
Example$response.entity.id 

Batch sizeString

The number of documents to be included in a single request. The incoming documents will be accumulated in a list up to the defined batch size before it is submitted to the endpoint

Make sure to set the batch size only if your REST endpoint expects a list.

Default Value: N/A
Example50

Show all headersCheckbox

The REST endpoint may return a response with multiple headers with the same header name.

  • If this property is deselected, only one response header will be shown in the output document.
  • If selected, the response header displays all the response header values received as a list of objects.

If any of these objects has a key-value format, it is parsed into the map data.

Default Value: Deselected
Example: N/A

Trust all certificates*Checkbox

Select this checkbox to trust all certificates, such as self-signed certificates.  

Default ValueDeselected
Example: N/A

Follow redirects*Checkbox

Select this checkbox to enable the Snap to follow redirects.

  • If you select this checkbox, the Snap receives a redirect response, such as a 301 or 302 response code, it sends another request to the URL specified in the response Location header.
  • If you deselect this checkbox, the Snap does not make another request, and the 301/302 response appears in the output view.

Default ValueSelected
Example: N/A

Query parameters

Use this field set to add query parameters to your request. This field set comprises the following fields:

  • Query parameter
  • Query parameter value

Query parameter

String

Specify the name (or key) of the query parameter.

Default Value: N/A
Exampleoauth2_access_token

Query parameter value

String/Expression

Specify the value associated with the query parameter.

Default Value: N/A
Example$account.access_token

HTTP header

Use this field set to create the HTTP header key-value pairs required for defining the headers for different types of input (JSON, PDF, DOCX, and so on). If you want to specify only content-type headers, you can configure the Multipart Content-Type property instead. This field set comprises the following fields:

  • Key
  • Value

Key

String

Specify the name that you want to use for the HTTP header.

Default Value: N/A
ExampleUser-Agent

Value

String/Expression

Specify the value that you want to assign to the HTTP header.

Default Value: N/A
ExampleSnapLogic

Response entity typeString

The excerpt 'Response_Entity_Type' was not found in the space 'SD' or you may not have the necessary permissions to access it.

Default ValueDEFAULT
ExampleTEXT

Read timeoutInteger

Specify the number of seconds for which the Snap waits before aborting the request due to a failure to read from the target service.

  • In some cases, the request does not return, such as during network issues. For those a timeout can be configured to allow failing fast. 
  • Every Snap instance can have its own timeout settings.
  • The Snap will execute five retries within a couple of seconds back-off time before it fails.

Default Value900
Example1500

Connection timeoutInteger

Specify the number of seconds for which the Snap waits before aborting the request due to a failure to establish a connection to the target endpoint or service.

Default Value30
Example45

Maximum request attemptsInteger

Specify the maximum number of attempts that the Snap must make to receive a response. If the attempts do not result in a response, the Snap terminates the request.

Default Value5
Example3

Retry request intervalInteger

The excerpt 'Retry_Request_Interval' was not found in the space 'SD' or you may not have the necessary permissions to access it.

Default Value3
Example10

Normalize URLCheckboxSelect this checkbox to normalize the Service URL. This enables the Snap to convert double slashes (//) in the URL path to single slash (/).
For example,
https://example.com/path//to//file is converted to https://example.com/path/to/file.

Deselecting this check box reverts the Snap to 4.19 Snaplex behavior, wherein the URL paths were not normalized by default.

In the 4.20 Release, due to the HTTP client upgrade the URL paths were normalized by default. Hence, there was a change in behavior in handling the URL paths in 4.20 release when compared to 4.19. This change in behavior should not impact the existing Pipelines, because most of the websites map URL paths with double or single slashes to the same endpoint. For example, https://snaplogic.com/company/diversity and https://snaplogic.com//company//diversity direct to the same endpoint. Therefore, we recommend you to select the Normalize URL checkbox.

However, an exception to this is when you use non-standard URLs that differentiate the URL paths containing double slashes from those with single slashes and map them to different endpoints, in which case you must deselect Normalize URL check box. 
For example, http://host/pages/foo.html and http://host/pages//foo.html point to different URIs, and servers assign different meanings to them.

Default ValueSelected
ExampleDeselected

Snap ExecutionString

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

ExampleValidate and Execute

Troubleshooting

ErrorReasonResolution
Batch execution failedThe Pipeline ended before the batch could complete execution due to a connection error.

Verify that the Batch size field is configured to handle the inputs properly. If you are not sure when the input data is available, configure this field as zero to keep the connection always open.

The provided URI is invalidIllegal character in scheme nameVerify the URI and parameters that you provide are syntactically correct.
URL Parse Exception - 403The Service URL path might be containing any of the following special characters: !, =, %, #, $, ^&()_¢äâêîôûñç¡¿ÉÙËǨ°¸ðø©¢¾A+²½µ®§÷¶þ 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

Creating and Deleting an Account in Salesforce Using REST Snaps

In this example Pipeline, we demonstrate how we create an account in Salesforce and delete it using REST Snaps.


Prerequisites: To use this example, you need at least an account in the free version of Salesforce. To create a Salesforce account, see Salesforce Developers.

Initially, we configure the JSON Generator Snap—we enter a name Test Account—the account that you want to create.


Then, we configure the REST Post Snap to create an account in your Salesforce instance using the account-name string of your choice. To do so:

  1. We use the URL provided by Salesforce for managing the accounts available in your instance.
  2. We use '$' in the HTTP entity field to indicate that we want to use the string coming from the Snap upstream.
  3. We add an HTTP header to the Snap, instructing Salesforce to read the document coming in as a JSON file.


We click the Account tab and select the account that we want to use with the Snap.


When we validate the Snap, it creates an account in the Salesforce instance and displays the following output:



The id field lists out the unique identifier of the new account created by the Snap.

We now want to delete the account that you just created. To do so, we need to isolate the account ID from the REST Post Snap's output. We use a Mapper for this task.


Upon validation, the Mapper Snap displays the following output:


We now use the REST Delete Snap to delete the newly-created account.


When the Snap is executed, the account is deleted.

Downloads

Important steps to successfully reuse Pipelines

  1. Download and import the pipeline into the SnapLogic application.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.

  File Modified
No files shared here yet.

Error rendering macro 'excerpt-include' : No link could be created for 'REST Snap Pack'.

  • No labels