REST Trigger

Use the REST trigger, ReceiveHTTPMessage, when creating flows that require invoking RESTful web services that provide some input necessary to activate the flow. The ReceiveHTTPMessage trigger is used when you want to expose your flow as an API, making it accessible by other apps running on either the TIBCO Cloud™ or elsewhere. This trigger must be configured to set up the fields for a request that the server receives from a REST client.

Settings

Field Description
Port By default, the port on which the trigger listens is set to 9999. You can change this to use another port to that is open.
Secure Connection By default, it is set to False. If you set this field to True, you can create a secure endpoint by providing Server Key and CA or Server Certificate.

Server Key - A PEM encoded private key file

CA or Server Certificate - A PEM encoded CA or self-signed server certificate file

Method The REST operation which the flow implements, for example GET, PUT, POST, or DELETE. This is a non-editable field since each REST flow implements a single operation.
Path The resource path for the operation. By default, the path displayed here is the resource path you had entered when you created the flow. The Path field is editable. For example, if you want to add a path parameter for a GET operation, you can do so by editing the resource path in the GET flow. If you edit the path in the Path field for a particular REST operation flow, the edited resource path will be applicable only to the flow in which it was edited.

Two resource paths with same base path should not contain path parameters at the same location. For example, you cannot have the following paths in the same application:

  • /books/{ISBN}/Author/{releaseDate} and /books/{ISBN}/Author/releaseDate is considered the same from a routing perspective.

    In these two paths, since the ISBN value is dynamic, it will cause a conflict during path resolution.

  • /books/{ISBN}/{releaseDate} and /books/{ISBN}/Author in the same application is not supported.

    Although the two paths appear to be different, when a message comes in, the router mechanism cannot know which path to call (the one with parameter or the one without) since the actual value has been substituted for the paramter.

  • Resource path with two different path parameters at the same URL sub-section. For example, /0.6/api/account/{account}/orderhistory/{orderhistory}/branch/{branch} and /0.6/api/account/{AccountKey}/Price?ProductList={ProductList}

    In these paths even though the paths differ after the base path (/0.6/api/account/), there will be a conflict when resolving the {account} and {AccountKey} values.

  • Multiple REST resources with same base path and same number of path parameters. For example, /resource/{id} and /resource/{id1}
  • /messages/{messageid}/comments/{commentid} and /messages/{messageid}/likes/{likeid}

    where the paths differ after {messageid}.
Output Validation When set to True, the incoming data (body, headers, and query parameters) is validated against the configured JSON schema. By default, it is set to False.

Output Settings

Field Description
Query Parameters 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.

repeating: Set to True if more than one value is expected for the query parameter.

required: Set to True if query parameter is a required configuration. The trigger will report an error if no value(s) are provided to the required query parameter.

Path Parameters Path parameters that are appended to the path.
Headers Header values for the trigger. 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.

repeating: Set to True if more than one value is expected for the HTTP header.

required: Set to True if header parameter is a required configuration. The trigger will report an error if no value(s) are provided to the required header parameter.

Request Schema Request schema for the trigger. Be sure to use straight quotes for element names and values in the schema.

Map to Flow Inputs

The Output tab displays the query, header, and path parameters and the body configured for the operation in a tree format.

Reply Settings

Field Description
Reply Data Schema The schema used for the reply data of the trigger. Be sure to use straight quotes for element names and values in the schema.

Map from Flow Outputs

Field Description
code HTTP code
data Body of the reply
message Use this field to enter the details for a response code, particularly for giving error details
Related reference