Invoke REST API
Invoke REST API asynchronous activity invokes RESTful web services and receives responses from the service provider.
General
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: This field is mandatory.
|
HTTP Method | No | The REST methods used for the requests.
Select from one of the following available methods:
|
Request Type | No | The value of the Content-Type header set while invoking the REST operation.
|
Response Type | No | The value of the
Accept header set while invoking the REST Operation.
|
Description
Provide a short description for the Invoke Rest API activity.
Advanced
The Advanced tab has the following fields.
Field | Description |
---|---|
Output HTTP Response Headers | Selecting this check box displays the HTTP headers received in the response. |
Request Entity Processing | This field has two values:
The default value is Chunked. |
Activity Timeout (seconds) | Timeout to invoke a RESTful web service and receive a response from the service provider after an Invoke REST API call is sent.
The Default Timeout is three (3) minutes. |
Input
The following is the input for the activity.
Input Item | Datatype | Description |
---|---|---|
ResourcePath | string | This value overrides the value provided in the Resource Path field on the General tab. |
Message Body | string | 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.
For more information about the fields and content of the header of an HTTP request, see the W3C HTTP specification at w3.org.
|
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:
|
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. |
MessageBody | The body of the response message. This is asciiContent. |
Fault
The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective action to take, see the TIBCO ActiveMatrix BusinessWorks™ Error Codes.
Fault | Generated 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. |
Resilience4jCircuitBreakerOpenException | This exception is thrown when the circuit breaker is open. |
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 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. |