API & testing

Environments and variables

Reuse URLs, parameters and values across requests.

Creating an environment

  1. Open Environments in the API section.
  2. Create an environment and add name/value pairs.
  3. Select it above the request editor.
  4. Use {{variable_name}} in URLs, headers, bodies and authentication settings.
base_url = http://127.0.0.1:59740/v1
order_id = 1064

GET {{base_url}}/orders/{{order_id}}
A shared API base URL and request identifiers in the Local demo environment.

Variable scopes

Variables can belong to collections, folders and environments. DataRay resolves available scopes when preparing a request. Collection runs can also use values from a data file.

Keep sensitive values in the designated secret fields. Review variable and secret inclusion settings when exporting.