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 displayed only if you upload a JSON file in the API Spec field.

All resource paths available in the JSON file are listed in the dropdown. Depending on the resource path you choose, the supported operations are listed in the Method field.

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.
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:
  • text/plain
  • application/json
  • application/x-www-form-urlencoded
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 URL
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

Note: If you upload a JSON file in the API Spec field, the fields in Input Settings are automatically populated according to the Resource Path you select.
Field Description
Query Params Query parameters to be appended to the path. To add the query parameters, click the button and press Enter to save your changes.

parameterName: Name of the query parameter.

type: The data type of the query parameter. Supported types are string, number, or boolean.

required: Set to True if query parameter is a required configuration. The trigger reports an error if no values are provided to the required query parameter.

Path Params Path parameters that are appended to the path. This is a non-editable field.

parameterName: Name of the path parameter. This is the parameter specified in between { } in the Resource Path field or the URL field in Settings.

type: The data type of the path parameter. Supported type is string.

Request Headers Header values for the InvokeRESTService activity. To add the header parameters, click the button and press Enter to save your changes.

parameterName: Name of the header parameter.

type: The data type of the header parameter. Supported types are string, number, or boolean.

required: Set to True if header parameter is a required configuration. The trigger reports an error if no values are provided to the required header parameter.

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.

Input

Note: If you upload a JSON file in the API Spec field, the Input fields are automatically populated according to the Resource Path and Method you select.
Field Description
host Specify the value which will override 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

Note: If you upload a JSON file in the API Spec field, the fields in Output Settings are automatically populated according to the Resource Path you select.
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 button. Enter the following details:

  • Code: Enter a specific response code or configure a single schema for a category of response codes. For example, if all the status codes are similar (such as 501, 502, 503, and so on), you can define a single schema (as 5xx) for them. Defining a single schema saves you time and effort as you do not need to configure each status code separately in the activity.
    Note: If the status code is provided as a range (5xx in the above example) and also an absolute format (501 in the above example), the status code in the absolute format is given priority. In the above example, status code 501 is given priority over 5xx at runtime.
  • Type: Select the type of response expected for the Code. Supported types are String and Object.

  • Response Body: If Object is selected as the Type, enter the JSON schema in the Response Body column. For String, you need not enter anything in the Response Body column.

  • Actions: The actions displayed change based on the type of the response code.
    • Edit, Delete: For an Object type of response, you can edit the details or cancel it.
    • Save, Cancel: For a String type of response, you can save or cancel the changes.

The response codes appear in the Output tab.

Response Schema
Note: This field appears only when Configure Response Codes is set to False.
The schema for the reply that the server sends.
Response Type
Note: This field appears only when Configure Response Codes is set to False.

The content type of the REST service. The following content-types are supported:

  • text/plain
  • application/json
  • other
Response Headers The header parameters for the reply.

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 Cloud™ Integration - Flogo® (PAYG) 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" in TIBCO Flogo® Enterprise User's Guide for details on how to map elements.

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.
Note: To update these settings for an activity configured from Swagger 2.0 or OpenAPI 3.0 specification, make changes in the API specification file and upload it in Settings. Do not update the activity settings as manual updates are removed.