REST Trigger - ReceiveHTTPMessage
Use the ReceiveHTTPMessage REST trigger when creating flows that are going to be invoked by an external REST call. The ReceiveHTTPMessage trigger exposes your flow as an API, making it accessible by other apps running on either 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.
Trigger Settings
Field | Description |
---|---|
Trigger Settings | |
Port | By default, the trigger listens on the port 9999. You can change this to use another port that is open.
Important: If the app has multiple triggers that require a port to be specified, specify a unique port number for each trigger. Two triggers in the same app cannot run on the same port.
|
Configure Using API Specs |
While creating a REST trigger, you can configure it by uploading an API specification file. If the API specification changes, you can merge the changes into an existing app by uploading the specification file again. To do this, click True and specify the following:
Default: False |
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 |
Handler Settings | |
Method | The REST operation which the flow implements, for example GET, PUT, POST, or DELETE. |
Request Type |
This field appears only when Method is POST or PUT. Select one of the following types from the drop-down list:
Default: Note: If you create a Flogo app using an API specification file having Request Type as
application/x-www-form-urlencoded or multipart/form-data , then you must click the Sync button to update the request parameters with the Flow Input. |
Path |
The resource path for the operation. If you upload an API specification file, select a path from the drop-down list. By default, the path displayed here is the resource path you had entered when you created the flow. The Path field is editable if you have not uploaded an API specification file. 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 is 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:
|
Output Validation |
When set to True, the incoming data (body, headers, and query parameters) is validated against the configured JSON schema. Default: False |
Output Settings
Map to Flow Inputs
This tab allows you to map the trigger output to flow input.
Reply Settings
Field | Description |
---|---|
Configure Response Codes | Allows you to configure response codes.
Default: False (See "Reply Data Schema" in this table.) To specify a response code, select
True and click the
The response codes appear in the Map from Flow Outputs tab. Note: The REST reply data type is by default set to data type
any . For multiple response codes, use the
ConfigureHTTPResponse activity in the flow to map
Response Body and
Response Headers from the REST trigger with the
Input in the activity. To configure
ConfigureHTTPResponse activity, see
ConfigureHTTPResponse.
The image shows the Reply Settings with multiple response codes. Caution: If you modify the response code schema in the table, the corresponding
ConfigureHTTPResponse activities within that flow do not change appropriately. This happens specifically when removing fields from the
Reply Settings tab. Redo the mappings for the
ConfigureHTTPResponse activities.
|
Reply Data Schema |
Note: This field appears only when
Configure Response Codes is set to
False.
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
Map the flow output to the trigger reply on this tab.