Web Service stencil

The Web Service stencil will send documents and metadata to REST API endpoints. The connector is flexible and can be configured in a variety of ways to meet your requirements.

Available connections

There are two outgoing connections from a Web Service stencil: green if the export was successful and red if the export failed.

Configuration

  1. To access stencil properties, double-click a Web Service stencil. Or, right-click a Web Service stencil and select Properties.

  2. Configure the stencil, then click Save.

End Point tab

Action: Select the HTTP method used to communicate with the web service. The following options are available:

  • POST request is used to create data on a platform.

  • PUT request is used to modify a resource. It updates the resource with data passed in the body payload. If no resource matches the request, it will create a new resource.

  • GET request retrieves data.

URL: The web service URL. This field supports data field substitution.

Timeout: The amount of time, in seconds, the server will wait to connect to the Rest API before it fails.

Headers tab

HTTP headers are used to pass additional information between the clients and the server through the request and response header.

Some standard header examples are: 

  • Authorization: Basic <credentials>: used to request HTTP basic authentication credentials.

  • Content – Type: application/x-www-form-urlencoded: is used to define the content type for the body of the request. This is used for POST and PUT requests.

  • X-API-Token: value: used to pass your API key. The API key is an access token that a client provides when making API calls. It is a straightforward way to secure access and a popular authentication method used with REST APIs.

  1. Click Add.

  2. In the Header box, enter a header. This field supports data field substitution.

  3. In the Value box, enter a header value. This field supports data field substitution.

  4. Repeat Steps 1 - 3 to add additional headers.

Body tab

The body is used to send and receive data via the REST API.

Type: You can send/receive the actual document or manipulate the transmission of the document’s data by using substituted text.

Body: When you have selected Substituted Text from the Type drop-down, you can enter the substituted text in the Body field. This field supports data field substitution.

The follow special variables are also supported in the body:

MESSAGE_CONTENTS_BASE64: is commonly used when there is a need to encode binary data that needs to be stored and transmitted over media that is designed to deal with ASCII. This ensures data remains intact without changes during the transmission.

MESSAGE_CONTENTS_JSARRAY: an array is a single variable in JavaScript that is used to store various elements. It is a collection of elements in a list, for example, objects, strings , numbers, or other data type.