For the complete documentation index, see llms.txt. This page is also available as Markdown.

API

Call a registered API mid-test to seed data, fetch an expected value, or check the UI against the backend.

Drizz calls a registered API in the middle of a test. Register the API once, then call it by name with API: <name>.

Platforms

Android · iOS

Register first

Editor → API → paste a cURL command → save under a name

Response refs

API.<name>.response · .request · .status_code · plus dotted paths

Position

An API step may come before OPEN_APP

Watch out

"API file not found" means the name in the script doesn't match a registered API

Prerequisites

  • Drizz desktop app installed and signed in

  • A working cURL command for the endpoint, including headers

  • The internal flag enabled on the API, for endpoints reachable only from your own network

Copy this

# ShopEase — the cart total on screen matches the backend

API: shopease_cart
  # BEGIN shopease_cart
  {
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer <your_token>"
    }
  }
  # END shopease_cart

SET cart_total = API.shopease_cart.response.total
SET item_count = API.shopease_cart.response.items.length

OPEN_APP com.shopease.android
Wait Until 5 Seconds

Tap on Cart
Wait Until 2 Seconds

Validate that the Order Total on screen matches {{cart_total}}
Validate that the number of items in the cart matches {{item_count}}

Register an API

APIs are registered, not written inline. A registered name is what the script calls, and a cURL command carries the headers across without retyping.

  1. Open Editor → API in the desktop app.

  2. Paste a cURL command for the endpoint.

  3. Enter a name in the save as field — shopease_cart.

  4. Save the API.

  5. Write API: shopease_cart in a test and run it. Confirm the step reports a status code.

Calling it

The request block sits indented under the call line, between # BEGIN <name> and # END <name>, and holds JSON. Headers and body set here override the registered values for this test.

API blocks stay expanded, unlike module blocks. The payload is part of the test.

API: is the current keyword. EXECUTE_API: is the legacy form and still runs, so old scripts keep working. Write API: in anything new.

Using the response

Reference
Gives you

API.<name>.response

The whole response body

API.<name>.response.<path>

Any dotted path into the body

API.<name>.request

The request that was sent

API.<name>.status_code

The HTTP status code

Assign a reference to a variable with SET, then reference the variable as {{var}}. See Store & SET for what else SET accepts.

Where the call runs from

API calls go out from Drizz's cloud. No configuration is needed.

A localhost or LAN endpoint called from the cloud times out after roughly 24 seconds.

An API flagged internal is routed through your desktop app. The request leaves from your own machine and hits your own DNS, so VPN-only and internal-network endpoints work without allowlisting any Drizz IPs.

The flag is set per API, not per organization, so one test can hit a public endpoint and an internal one. Ask Drizz support to enable it on a given API.

Check the UI against the backend

Assert that what the app shows matches what the backend returned.

  1. Launch the app and reach the screen.

  2. Call the API.

  3. Check the call succeeded.

  4. Compare the response to the screen.

Seed data before the app opens

An API step can run before OPEN_APP, which sets a known state without clicking through the UI to build it.

Location-specific content

Fetch what the backend returns for a location, then check the app agrees.

Common mistakes

What you write
What happens

API: shopease_cart when it's registered as shopease-cart

"API file not found". The names must match exactly

An API step with no registered API behind it

"API file not found" — register it first

# BEGIN shopease_cart# END cart

Names don't match, the block doesn't parse

Editing the request block expecting it to collapse

API blocks stay expanded by design. That's not a bug

EXECUTE_API: get_cart(user="42") in a new test

Legacy form. Still runs, but write API: and put args in the block

Calling a localhost endpoint without the internal flag

The call leaves from the cloud and times out after ~24s

SET total = API.shopease_cart.response.total with no status check

A 500 gives you an empty value and a confusing failure three steps later

Next


Last updated: 6 August 2026

Last updated

Was this helpful?