Configuring the REST Reply
When creating a REST app from a Swagger 2.0 or OpenAPI 3.0 API specification, the
ReceiveHTTPMessage reply data type is set to
any
by default. You must explicitly configure the reply type.
To explicitly configure the reply type, add a ConfigureHTTPResponse Activity in the flow. This Activity must immediately precede the Return Activity in the flow.
Follow these steps to configure your HTTP reply:
- Procedure
- Open the REST trigger configuration pane by clicking it.
- On the Reply Settings tab of the ReceiveHTTPMessage REST trigger, configure the custom codes that you want to use. Refer to the section, "REST Trigger".
- Add a ConfigureHTTPResponse Activity immediately preceding the Return Activity in the flow.
- Open the
ConfigureHTTPResponse Activity by clicking it and configure it as follows:
- On the
Settings tab:
- If your flow is attached to multiple REST triggers, select the trigger in which you have configured the code you want to use from the Trigger Name drop-down menu. The Trigger Name field does not display if your flow is attached to only one REST trigger.
- Select a response code from the Code field menu. Only the codes configured in the selected trigger are displayed in the menu.
- The Input tab displays the schema for the response code. Map the elements or manually enter a value for the elements.
- Click Save.
- On the
Settings tab:
- Configure the
Return Activity by mapping the
code and body (which is currently of data type
any
). - Click Save.
- On the Map from Flow Outputs tab in the ReceiveHTTPMessage trigger, map the code and body to the corresponding elements from the flow output.
- Click Save.