Configuring the REST Reply

When creating an app from a REST Swagger 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.

You can configure custom codes that you want to use in the HTTP reply in the Reply Settings tab of the ReceiveHTTPMessage trigger.

Follow these steps to configure your HTTP reply:

Procedure

  1. Open the REST trigger configuration pane by clicking on it.
  2. In the Reply Settings tab of the ReceiveHTTPMessage REST trigger, configure the custom codes that you want to use. Refer to the section, "REST Trigger" in the Activities and Triggers Guide.
  3. Add a ConfigureHTTPResponse activity immediately preceding the Return activity in the flow.
  4. Open the ConfigureHTTPResponse activity by clicking on it and configure it as follows:
    1. In the Settings tab:
      1. 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.
      2. Select a response code from the Code field menu. Only the codes configured in the selected trigger are displayed in the menu.
    2. The Input tab displays the schema for the response code. Map the elements or manually enter a value for the elements.
    3. Click Save.
  5. Configure the Return activity by mapping the code and body (which is currently of data type any).

  6. Click Save.
  7. In the Map from Flow Outputs tab in the ReceiveHTTPMessage trigger, map the code and body to the corresponding elements from the flow output.

  8. Click Save.