Call a REST Service Method from a Process

To call a REST service method from a process, do the procedure in this topic.

REST Access Token Screen









Prerequisites

  • A valid REST Service.

Good to Know

How to Start

  1. On the Organizer, do one of these:
  2. Do one of these:
    • Add an activity:
      1. In the Process Builder, in the Activity Library, open the Web Services tab.
      2. On the Web Services tab, drag the REST Service activity onto your process.
    • Change an activity:
      1. In your process, double-click your activity.

Procedure

  1. Complete the fields on the General Configuration screen.

    For more information, refer to Configure General Options for the REST Service.

  2. Click REST Access Token .
  3. On the REST Access Token screen, in the REST Service list, select your REST service access token.

    To create a new access token, click Add Token . For more information, refer to New REST Access Token.

    • To connect to the REST service, in the REST Service list, select your REST service access token.
    • (Optional) To do advanced configuration for the REST service, do this procedure.
      1. Select Advanced Configuration.
      2. Click REST Configuration .
      3. On the Advanced REST Configuration screen, do this procedure.
        1. In the Request URL field, enter the REST service request URL for your method.
        2. In the Action field, select the type of action for the REST service to do.
        3. In the Content-Type field, select the type of content the REST service uses.
        4. In the Accept field, select the data format to accept in a REST service.
        5. In the Protocol field, select the communication protocol for your REST service.
        6. In the Request Timeout(seconds) field, select the maximum amount of time, in seconds, allowed for the completion of the REST service call for the activity.
        7. In the ReadWrite Timeout(seconds) field, select the maximum amount of time, in seconds, for read and write methods.
        8. Complete these fields as necessary.
          Field Name Definition

          Header Information

          Function:
          Specifies the custom headers for the REST service.

          Request headers are usually used to give security information, such as authentication credentials.

          Accepted Values:
          • Header
          • RunTime Value
          Default Value:
          None
  4. Click REST Request Payload .
  5. On the REST Request Payload Configuration screen, do one of these:
    • To configure the custom payload details for the REST Service request, do this procedure.
      1. Select Custom Payload.
      2. Enter payload values in the box to use when the process runs. The values of the payload must be in JSON/XML format.
    • To map the PayLoad with Schema, do this procedure.
      1. Select Map Payload with Schema.
      2. In the box, enter the payload values which you want to map from process schema.
      3. Click Map Schema.
      4. On the Schema Mapper screen, map the request columns to the schema elements.
  6. Click REST Response .
  7. On the REST Response Configuration screen, to connect response data from the REST service call to your process, do one of these.
    • To connect the response to a process data variable, complete this field as necessary.
      Field Name Definition

      Save Response to Custom Attribute

      Function:
      Specifies the variable that contains the response to a method call. The method calls a REST service.
      Accepted Values:
      A process data variable.

      You can use Process Data screen to specify a process data variable.

      Default Value:
      None
      Accepts Process Data Variables:
      Yes
    • To connect the response to your process schema, do one of these:
      • Select Map Response to Process Schema.
        1. Select Enter Sample Response.
        2. In Schema field, drag a variable from Process Data screen to use for the custom header.
        3. In the Header field, enter the name of the custom header.
      • Select Map Response to Process Schema.
        1. Select Get Response from Simulation.
        2. Click Simulate.
        3. On the REST Response Configuration > Simulate screen, click Simulate.
        4. Click Save.
        5. Click Back .
        6. In the Schema field, drag a variable from Process Data screen to store the value of the header.
      • Select Map Response to Process Schema.
        1. Select Get Response from Simulation.
        2. Click Adhoc Mapping.
        3. Complete the fields on the REST Response Configuration > Ad Hoc Mapping screen.
        4. Click Back .