InvokeRESTService
This activity is used to make a request to a REST service; it also accepts the reply returned by the service.
Settings
Field | Description |
---|---|
API Spec | (Optional) Click
Browse and browse to the file location on the machine. Select a JSON file.
Supported specifications are Swagger Specification 2.0 and OpenAPI Specification 3.0. |
Resource Path |
Note: This field is only displayed if you upload a JSON file in the
API Spec field.
All resource paths available in the JSON file (that is, the Swagger 2.0 or OpenAPI 3.0 specification file you uploaded) are listed in the drop-down. Depending on the resource path you select, the supported operations are listed in the Method field. |
Enable Authentication |
Select True if you want to enable authentication and authorization for your applications using the HTTP Client Authorization Configuration connection. Default: False |
Authentication Connection |
Note: This field is displayed only if the Enable Authentication field is set to True.
Select a connection that you have set up from the drop-down list. For information on setting up a connection, refer to HTTP Client Authorization Configuration. |
Method | Select an operation for the request. For example: GET, POST, PUT, DELETE, or PATCH. |
URL | An absolute path to the REST service that you want to invoke. For example:
http://acme.com or
https://acme.com . If you enter an absolute path beginning with
https:// , the
Use certificate for verification section appears.
If your connection requires an SSL certificate, select True. Otherwise, select False. To add a certificate, under Server Certificate, click Browse and browse to the certificate location on the machine. Note: If you upload an OpenAPI 3.0 JSON specification file in the
API Spec field, the
URL is a drop down menu. This lists the server URLs mentioned in the JSON file. Select a server URL from the list. Tip: To dynamically override the path provided in the URL, you can enter the URL as: http://<host-url>:port/{path} Here, {path} is the parameter which can be modified. You can map this parameter in the Input section and assign values to it from the previous activities or the app properties. |
Timeout |
Specify the timeout period (in milliseconds) for invoking a service. If a timeout value is specified, the activity waits for the specified time. If a response is not received by the specified time, the request expires with an error. Default: 0 milliseconds (that is, there is no timeout for invoking a service) |
Request Type |
Note: This field is displayed only for the POST, PUT, and PATCH methods.
The Request content type of the REST service. The following content-type are supported:
Note: If you select
application/x-www-form-urlencoded , the default schema is set in the
Request Schema field of the
Input Settings tab. You can edit the default schema or specify your own schema. If you specify your own schema, it must be a name-value string pair.
|
Proxy |
Specify the URL to the HTTP proxy server. If a proxy URL is specified, the request to the REST service (specified in the URL field) is routed via this proxy URL. Note: A secure connection to the proxy server is not supported.
Default: Proxy URL is disabled. |
Input Settings
Field | Description |
---|---|
Query Params | Query parameters to be appended to the path. To add the query parameters, click the
![]()
|
Path Params | Path parameters that are appended to the path. This is a non-editable field.
|
Request Headers | Header values for the InvokeRESTService activity. To add the header parameters, click the
![]()
|
Request Schema | Enter a request schema here. This field is visible only if you selected the POST, PUT, or PATCH method in the
Settings tab.
Note: If you selected
application/x-www-form-urlencoded as the
Request Type in the
Settings tab, the default schema is set here. You can edit the default schema or specify your own schema. If you specify your own schema, it must be a name-value string pair.
|
Multipart Data |
This field is displayed in place of the Request Schema field if you select
|
Input
Field | Description |
---|---|
host | Specify the value which must override the
hostname:port value specified in the URL at runtime with the value specified in this configuration. Enter a value in the form
hostname[:port] where
[:port] is optional.
|
queryParams | Provide a value to the query parameters configured on the Input Settings section. This field is visible only if you selected the POST or PUT method in the Settings tab. |
pathParams | Provide a value to path parameters defined as part of URL in the Settings tab. This field is visible only if you selected the POST or PUT method in the Settings tab. |
headers | Header values for the activity. These values can be manually entered or mapped to the output of the trigger or any preceding activity. |
body | Request Schema values for the activity. These values can be manually entered or mapped to the output of the trigger or any preceding activity. This field is visible only if you selected the POST or PUT method in the Settings tab. |
Output Settings
Field | Description |
---|---|
Configure Response Codes | Allows you to configure response codes.
Default: False (See "Response Schema" and "Response Type" in this table.) To specify a response code, select
True and click the
The response codes appear in the Output tab. |
Response Schema |
Note: This field is displayed only when
Configure Response Codes is set to
False.
The schema for the reply that the server sends.
|
Response Type |
Note: This field is displayed only when
Configure Response Codes is set to
False.
The content type of the REST service. The following content-types are supported:
Default: Note: JSON to XML conversion is not supported by the REST activity. Any service that requires data in XML format cannot be invoked after providing data in the JSON format using REST activity.
|
Output Format |
Note: This field appears only when the Response Type is set as
application/xml .The format of the request content for the
|
Response Schema |
Sample JSON schema for the response that the REST service returns. The JSON schema in this field is editable for the following settings only:
|
Response Headers |
The header parameters for the reply. Tip: If you want to fetch a cookie coming with a response, add a new row with
Set-Cookie as the parameter. You can also map this parameter to subsequent activities in the flow. |
Output
The Output tab displays the headers and response body configured for both the request and the response in a tree format.
Loop
Refer to the section on "Using the Loop Feature in an Activity" in the TIBCO Flogo® Enterprise User's Guide for information on the Loop tab.
Retry on Error
This tab allows you to set the number of times the flow should try to execute the activity if it encounters a retriable error (such as waiting for a server to start, intermittent connection failures, or connection timeout) during the activity execution.
Map the elements in the schema using the mapper or alternatively, enter values for the element by manually typing the value in the mapper. See the section on "Using the Mapper"
Field | Description |
---|---|
Count | The number of times the flow should attempt to execute the activity. |
Interval | The time (in milliseconds) to wait in between each attempt to execute the activity. |