How-to

The API call action

Call any REST or GraphQL API from inside a care flow to fetch or send data, and store the response in data points the flow can build logic on.

The API call action is the general-purpose way for a care flow to talk to any REST or GraphQL API: pull data in, push data out, or trigger something in another system.

When a prebuilt connector exists, an extension is usually less work.

Get or send data

An API call action can get data out of another system or send data into it, which is also how a care flow triggers an action there.

Awell supports REST and GraphQL. REST has HTTP verbs like GET and POST, GraphQL has queries and mutations, and configuring either is the same job in the interface.

Configure headers

Headers attach metadata to the call, and are most often used for authorization, such as an API key. Add them in the interface.

Put the key in a constant rather than typing it into each action, so there's one place to change it and no copies scattered through the care flow.

If the system uses OAuth rather than a static key, see Connecting to systems that require OAuth.

Populate the request body

The body carries the data being sent, or the query being asked. Use variables to insert care flow data, such as a patient identifier or a form answer, so each call is specific to that patient.

Store the response in data points

Use JSON path to pick values out of the response and store them in data points. Once stored, they behave like any other data point: the care flow can branch on them, put them in a message, or pass them to the next call. Skip this step and the response is discarded.

Next steps

Next: Store static values in constants, worth doing before configuring a second API call.

On this page