getViaRest
A Workflow Engine function that receives a JSON payload or results from a REST endpoint and sets the results under workflowContext.values.<endpointName>.
This function is available as a feature of the Add-ons v2.3 download and later.
This function is available for alert, enrichment, and Situation workflows.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function getViaRest takes the following arguments:
Name | Required | Type | Description |
|---|---|---|---|
| yes | string | The name of the REST endpoint from integrations page (use the Get protocol). |
| yes | string | Payload maps name from integrations page, to be mapped to request params to REST endpoint. |
Example
The following example demonstrates typical use of Workflow Engine function getViaRest.
The getViaRest function downloads the results under workflowContext.values.<endpointName>. You can use subsequent actions such as:
copyFromContextto copy results fromworkflowContext.values.<endpointName>tocevent.custom_info.<KEY>.mergeListto condense results from different endpoints under single field either workflowContext or custom_info, for example:from
workflowContext.values.RESTEndpoints1,workflowContext.values.RESTEndpoints2toworkflowContext.values.mergedListor,
from
custom_info.enrichment.RESTEndpoints1,custom_info.enrichment.RESTEndpoints2tocustom_info.enrichment.restreduceObjectsListto reduce a list of similar objects to single object. You can apply this function to either workflowContext or custom_info fields, such ascustom_info.enrichment.RESTEndpoints1orworkflowContext.values.RESTEndpoint1.