Send an outbound REST web service request to an external system.

Note: REST step is not available in the base system and requires the ServiceNow® Integration Hub subscription. After the required plugin is activated, the step is visible under Integrations.

Outbound REST web service is a platform feature that enables you to retrieve, create, update, or delete data on a web services server that supports the REST architecture.

Roles and availability

Available as an Workflow Studio action step. Users with the action_designer role can create a custom action with one or more action steps.

Fields

Action error evaluation

If this step fails
Data type: Choice

Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.

REST response size limits

By default, the system limits the size of REST responses that are not saved as attachments to 5 MB. Direct REST responses that exceed this limit generate an error. To support larger response sizes, either save the response as an attachment or increase the response size limit with the glide.pf.rest.response_payload_max_size system property. This system property supports a maximum value of 10240 KB, which limits the REST response to 10 MB in size.

Parsing a REST response

REST API calls return data in the Response Body. The response body data is usually structured in JSON or XML format. You can use a Script step to parse the structured data into variables to use elsewhere in the action or in a flow. There is also an XML parser step to parse a response body that's in an XML format.

The general strategy to get extracted data from the response is to do the following.
  1. Review the response body to select the data to return.
  2. Create input and output variables in the Script step.
    • Create an input variable to pass in the Response Body from the REST step.
    • Create output variables to return data from the response.
  3. Create a script to parse and map data.
    • Use the JSON.parse() method in a Script step to parse a JSON response body.
    • Map the parsed data to the output variables.
  4. Create action outputs for the output variables to make the data available to a flow.
For a detailed example, see the section on Parsing a REST Response in the REST in IntegrationHub developer training.