Skip to main content

Rest API Call

The Rest API Call activity sends an HTTP request to an external REST API and optionally stores the response body in the workflow context for use by downstream activities.

Purpose

Use the Rest API Call activity to:

  • Trigger an action in an external system (e.g. start a job, submit a form, post an event)
  • Retrieve data from a third-party API and pass it into the workflow
  • Integrate with any web service that exposes a REST interface
  • Send JSON payloads constructed from workflow variables

Configuration

Data Source

Select a REST API data source. The data source defines the base URL, authentication headers, and any fixed query string parameters. Only data sources of type REST API are available here.

Data sources are configured in the Una administration area under Integrations.

HTTP Verb

The HTTP method to use:

VerbTypical use
GETRetrieve data, trigger a read-only endpoint
POSTCreate a resource, submit a payload
PUTUpdate an existing resource
DELETERemove a resource

Path

The URL path appended to the data source base URL. Do not include the base URL here — only the relative path.

Supports interpolation:

/api/jobs/{{var:JobId}}/start
/reports/{{var:Period}}/generate

Query string parameters defined in the data source are automatically appended to the final URL.

Content

The request body, sent as application/json. Required for POST and PUT requests; ignored for GET and DELETE.

Fully supports interpolation:

{
"period": "{{var:Period}}",
"entityId": "{{var:EntityId}}",
"triggeredBy": "{{ctx:username}}"
}

The editor highlights the field in red if a POST or PUT request has an empty content body.

Result Context Key

The workflow context variable name where the raw response body (as a string) is stored on a successful call.

Default key: HttpRequestWorkflowActivity_ResponseContextKey

Rename to something meaningful (e.g. ApiResponse, JobStatus). Leave the key empty if you do not need the response.

Behavior

  1. The Path and Content fields are interpolated.
  2. The HTTP client is configured with the data source base URL, authentication headers, and query string parameters.
  3. The request is sent with a 60-second timeout.
  4. If the response status code is a success (2xx), and a Result Context Key is set, the response body is stored in the workflow context.
  5. If the response is not a success, an exception is thrown with the status code, reason phrase, and response body — the activity returns Error status.

Usage Patterns

Trigger an External Job, Then Poll

Rest API Call (POST /jobs/start) ──> Delay (60s) ──> Rest API Call (GET /jobs/{{var:JobId}}/status)
└── Result Key: JobResponse

Post Workflow Results to an External System

Script (build JSON payload) ──> Save to context ──> Rest API Call (POST /results)
Content: {{var:ResultPayload}}

Conditional on API Response

Rest API Call (GET /entity/{{var:EntityId}}/status)
└── Result Key: EntityStatus


If ({{var:EntityStatus}} contains "locked")
├─[Yes]──> Stop ("Entity is locked")
└─[No]───> Continue

Usage Notes

  • The 60-second HTTP client timeout is fixed. For longer-running API calls, consider using an API that returns a job ID immediately and polling with a Delay + subsequent call pattern.
  • The response body is stored as a raw string. If the API returns JSON, use a Script activity to parse it into individual context variables.
  • Query string parameters defined in the data source are always appended to the URL. Do not duplicate them in the Path field.
  • Only REST API data sources are supported. SQL Server or other data source types will throw an exception.
  • For Zapier webhooks, use the dedicated Zapier activity instead — it is a specialised variant with Zap-specific property handling.

Best Practices

  • Store base URLs, API keys, and headers in the data source, not in the Path or Content fields. This keeps credentials out of the workflow definition and makes rotation easy.
  • Always wire an error arrow. Non-2xx responses are exceptions — without an error path, the workflow will stop unexpectedly.
  • Use a descriptive Result Context Key (CustomerApiResponse not the default key name) so its origin is clear when referenced later.
  • For POST/PUT requests, validate that your JSON content is well-formed. Malformed JSON will be sent but the API will likely return a 400 error.

JSON Reference

{
"discriminator": "HttpRequestWorkflowActivity",
"activityId": "<uuid>",
"name": "Rest API Call",
"positionX": 0,
"positionY": 0,
"advanceRule": 2,
"dataSource": "MyRestApiConnection",
"verb": 1,
"path": "/api/jobs/start",
"content": "{\"period\": \"{Period}\"}",
"responseContextKey": "ApiResponse"
}
PropertyTypeDescription
dataSourcestringCorresponds to the Data Source field. The REST API data source providing the base URL and authentication.
verbintegerCorresponds to the HTTP Verb field. 0 = GET, 1 = POST, 2 = PUT, 3 = DELETE.
pathstringCorresponds to the Path field. The URL path appended to the data source base URL.
contentstringCorresponds to the Content field. The JSON request body for POST/PUT requests. Supports {variable} interpolation.
responseContextKeystringCorresponds to the Result Context Key field. Workflow context key where the response body string is stored on success.