Documentation › Call an API

Call an API from a step

A Task step can call an external service (REST, SOAP or GraphQL): the person who does the task clicks a button, the service answers, and the values of the response go into variables of the process.

⏱ 6 minutes📍 Process editor, Task step · task page

How it works

  1. The designer opens the Task step in the editor and defines the call in the API call tab: where to call, with what, how to sign in, what to expect back and which values to keep.
  2. The definition is stored with the process. Nothing is called when the process is published.
  3. In a process instance, the person who does the task sees an API call panel and clicks Call the API.
  4. The response is shown, and the values kept are written into the outcomes (Outcomes) of the task, so into the variables of the process.

Define the call (API call tab)

In the form of the Task step, open the API call tab and click Add an API call. The Remove the API call button takes the call off the step, and the Documentation link opens this page. In front of each field, the (i) button explains what to type, with an example, and links to the matching section of this page.

The request

Path parameters: /{id}/{name}

Write the parts of the address that change between curly braces, for example https://www.site.com/{id}/{name}. In Path parameters, the Add the parameters of the address button creates one row per part; give each its value, typed here or taken from a variable (link button). The value is encoded for you: spaces and slashes do not break the address.

Query parameters and headers

Query parameters (added to the address: ?page=2&size=10) and Headers are “name / value” rows. Untick Send to keep a row without sending it. Content-Type is set from the type of body: write it only to use another one.

The body

Authorization

Authorization: secrets are hidden while typed and can come from a variable.

User authentication

When a service asks the person to log in, tick This call logs the user in (User authentication section). Draw this call, or these calls (one per step), according to the authorization of the service: token, session, etc.

The expected response

A call also fails when the service answers with a SOAP Fault or GraphQL errors, even with a 200 status.

Values to extract from the response

Values to extract from the response: each row reads a value in the response and puts it in a variable of the process. An outcome (Outcomes) is added to the step for each variable.

Use the variables of the process

Make the call in a process instance

On the page of a task of a Task step that has a call, the API call panel sums the call up (kind, method, address, authentication, expected statuses) and lists the Extracted values. Click Call the API:

Security and limits

Tips