Configuring a REST Connector to Invoke a REST Service

Configure a REST connector to invoke a REST service. In the REST connector, you specify an HTTP method and then provide the following additional details required for the connector to complete the request:

  • The path to a particular endpoint in the REST service.

  • Parameters, if required by the endpoint.

  • Key-value pairs for the HTTP header.

In the Orchestrator Studio, you can test the connector and view the JSON response of the REST service call. You can also use Groovy scripting to refine the data in the connector output. For example, you can configure a Groovy script to refine the contents of the REST service response so that the connector output contains only the data required by the consuming device or program.

To configure a connector to invoke a REST service:

  1. Create and name the connector service request as described in Creating a Service Request.

  2. On the Connector design page, click the Connection field and select a connection under the REST category.

    The Orchestrator Studio displays the URL to the REST service available through the connection.

  3. Click the HTTP Method drop-down list and select the appropriate method.

  4. Slide the Fire and Forget toggle to the right if you want the orchestration to execute without waiting for a response. If Fire and Forget is enabled, the Output section is hidden because the REST service response is not processed.

  5. Expand the Pathing section and use the Value grid to build the path to a REST service endpoint.

    Each value you enter in the Value grid is appended to the path, separated by a forward slash (/). You can use variables in the path by adding a value inside ${}. Click the Delete button at the end of a row to delete any values from the path.

    The following image shows an example of a path to an endpoint that includes variables.

    This image is described in the surrounding text.
  6. If the REST service takes parameters, use the Parameters section to append parameters to the endpoint.

    Parameters are appended to the endpoint after a "?" and are separated by a "&". You can include variables by specifying a value inside ${}.

  7. In the Headers section, enter key-value pairs for the header in the Key and Value columns. You can also choose any known values from the drop-down menu in each column.

  8. In the Body section (which is not used or displayed if the HTTP method is GET or TRACE), if the HTTP method requires it, specify a payload to send to the REST service.

  9. In the Output section, use the following sections to identify the outputs:

    Note: The outputs are based on the JSON response of the REST service call. You can see the response after running a successful test of the REST service using the Test button.
    • Manipulate Output (advanced). Use Groovy scripting to manipulate the output of the REST call. For example, if you only need certain data in the output, you can use Groovy scripting to refine the data displayed in the output. See Groovy Template for Manipulating Output from a REST Connector Response for more information.

    • Output grid. If the value you want is nested in JSON objects, you can get to the value by separating each JSON object name by a period (.). If the value you want is in an array, you can access it by adding the proper index of the array inside [].

    The following image shows an example of outputs defined in the Output section:

    This image is described in surrounding text.
  10. To test the connector:

    1. Click the Test button.

    2. If the connector includes variables, enter values for the variables in the popup box.

      If successful, the Orchestrator Studio displays the response.

    3. Click the Show Output button displayed at the end of the response to apply the instructions defined in the Output section, including the Groovy script if specified.

      Use the results to validate the path to the output values specified in the Output section.