Search Results

Invoke REST API

Invoke REST API asynchronous activity invokes RESTful web services and receives responses from the service provider.

General

Note: For the Invoke REST API activity to work, an HTTP Client shared resource is required. In the HTTP Client shared resource, make sure Apache HttpComponents (Supported by HTTP and REST) is selected as the Implementation Library in the HTTP Client section.

The General tab has the following fields.

Field Module Property Description
Name No The name to be displayed as the label for the activity in the process.
HTTP Client Yes The HTTP client resource.
Resource Path No The resource of the REST service.
Note: Spaces and special characters are not supported in the path and query parameter name.
HTTP Method No The REST methods used for the requests.

Select from one of the following available methods:

  • POST
  • GET
  • PUT
  • DELETE
  • PATCH
Request Type No The value of the Content-Type header set while invoking the REST operation.
  • JSON: the service provider returns the data in the JSON format.
  • XML: the service provider returns the data in the XML format.
  • Custom: to override the Content-Type value in the Input tab, select CUSTOM and provide the value in the Input tab.
Response Type No The value of the Accept header set while invoking the REST Operation.
  • JSON: the service provider returns the data in the JSON format.
  • XML: the service provider returns the data in the XML format.
  • Custom: to override the Accept header value in the Input tab, select CUSTOM and provide the value in the Input tab.

Description

Provide a short description for the activity.

Advanced

The Advanced tab has the following fields.

Field Description
Output HTTP Response Headers
Request Entity Processing This field has two values:
  • BUFFERED: the request entity is buffered in memory to determine the content length that is sent as a Content-Length header in the request.
  • CHUNKED: the entity is sent as chunked encoded (no Content-Length is specified, entity is streamed). The Transfer-Encoding header is set to Chunked.

The default value is Chunked.

Input

The following is the input for the activity.

Input Item Datatype Description
Message Body The body of the HTTP request message.
asciiContent string The ASCII content (ASCII content of the request like POST or PUT to the server) of the request to the HTTP server.
HttpHeaders string The header of the HTTP request. The header structure is defined by the HTTP protocol. See the HTTP protocol specification for more information about the fields and content of the header of an HTTP request.
  • Accept: specifies the media types that are acceptable for response messages for the incoming request. For example, text/*,text/html. Media types are described in the HTTP specification.
  • Accept-Charset: specifies the character sets that are acceptable for response messages for the incoming request. For example, iso-8859-5, unicode-1-1. Character sets are described in the HTTP specification.
  • Accept-Encoding: specifies the content-coding values that are acceptable for response messages. For example, compress, gzip.
  • Content-Type: the media type of the entity body sent to the receiver. Media types are described in the HTTP specification.
  • Content-Length: indicates the size of the entity body sent to the receiver.
  • Connection: the requestor can specify options desired for this connection. For example, the option close specifies that the requestor would like the connection to be closed when the request is complete.
  • Cookie: See the HTTP specification for more information about this field.
  • Pragma: is used to include implementation-specific directives that might apply to the receiver. See the HTTP specification for more information about using this field.
DynamicHeaders complex The dynamic header is an additional header parameter to add runtime headers to the outgoing HTTP messages. The DynamicHeaders consists of the following information:
  • Name: the name of the header
  • Value: the value of the header

Output

The Output tab has the following fields.

Output Item Description
StatusCode The HTTP Response Code.
ReasonPhrase ReasonPhrase is intended for giving a short textual description of StatusCode.
mesageBody The body of the response message. This is asciiContent.

Fault

The Fault tab lists the possible exceptions thrown by this activity. See Error Codes for more information about error codes and the corrective action to take.

Fault Thrown when...
HttpCommunicationException An HTTP exception occurred when trying to execute the specified method, or when trying to read the response.
HttpClientException The HTTP server replied with a message that has the 4XX status code.
HttpServerException The HTTP server replied with a message that has the 5XX status code.

Support for Path and Query Parameters

Invoke REST API activity supports both Path and Query parameters. For Path Parameters, enclose each path parameter in { } brackets. For example, if the resource path is set as /books/{isbn}, a PathParameters element is added to the activity input.



Multiple path parameters can be defined in a similar way. The activity also supports static URL content mixed with path parameters, for example, /books/{isbn}/events/{author}.

Query parameters are defined using the pattern /staticUrl?Param1&Param2.

A QueryParameters element is added to the Input tab of the activity with each of the parameter listed. For example, if the resource path is set as /books?isbn&author, a QueryParamters element is added to the activity input.



Policy

Activities that support policies will display the Policy tab. To associate a new or existing policy with the Invoke REST API activity, click the Add Policy to Activity icon. To edit policy details, click Go to selected Policy icon. The Policy tab has the following fields.

Field Description
Name The name of the policy.
Type The type of policy associated with the activity. The Invoke REST API activity can support the Basic Credential Mapping policy.
Description A description of the policy.