Skip to content
MyAppBuilder
StableGuide

API requests

The Request section of an API source defines what is sent: the HTTP method, the URL, headers, query parameters and, for writes, a body. Placeholders let one definition serve many calls — the city, the record id or the email come from whoever calls the API.

API requests

The Request section of an API source defines what is sent: the HTTP method, the URL, headers, query parameters and, for writes, a body. Placeholders let one definition serve many calls — the city, the record id or the email come from whoever calls the API.

When to use

  • GET to read data (lists, lookups).
  • POST to create something or trigger an action in the other system.
  • PUT / PATCH to update, DELETE to remove.

The request fields

FieldWhat to enter
MethodGET, POST, PUT, PATCH or DELETE
URLThe full address, e.g. https://api.example.com/v1/items/{{params.id}}
HeadersName / value pairs such as Accept: application/json (up to 30)
Query parametersName / value pairs appended to the URL as ?name=value (up to 30)
BodyText sent with non-GET requests, usually JSON (up to 20,000 characters)

A JSON body (starting with { or [) automatically gets Content-Type: application/json unless you set that header yourself; other bodies are sent as plain text.

Placeholders

Three kinds of placeholders work in the URL, headers, query values and body:

  • {{params.name}} — a value passed by whoever calls the API: the Parameters of a Call API action or step, or a test value. In the URL the value is encoded for safety; elsewhere it is inserted as is. Nested values work too ({{params.customer.email}}), and objects are inserted as JSON.
  • {{env.KEY}} — a plain environment variable from Settings → Environment & secrets (for example a base URL that differs between staging and production).
  • {{secret.KEY}} — a secret, inserted on the server only (Authentication).

The editor detects every {{params.…}} placeholder and lists them as parameters in actions, workflow steps and the test panel.

How to set up a request

  1. In APIs, select or create the API source.
  2. Choose the method and paste the URL from the service's documentation, replacing variable parts with {{params.…}}.
  3. Add required headers (Accept, Content-Type, custom headers). Put secrets in the Authentication section, not here.
  4. Add query parameters for GET filters (limit = 20, city = {{params.city}}).
  5. For POST/PUT/PATCH, write the body.
  6. Use Test request to try it with sample parameter values.
Example
POST  https://api.example-crm.com/v1/contacts
Headers:  Accept: application/json
Body:
{
  "email": "{{params.email}}",
  "name":  "{{params.name}}",
  "source": "{{env.APP_NAME}}"
}

Passing parameters

  • Call API action: under Parameters, add email = Form › email, name = Record › Name, and so on.
  • Call API workflow step: the Parameters list is pre-filled with the placeholders found in the request; bind each to record fields, results or templates.
  • Component bindings (Data tab) pass no parameters; use them for requests that need none.

Common mistakes

  • Spaces inside placeholders. {{ params.id }} is accepted, but {{params id}} is not.
  • Quoting numbers in JSON bodies. "qty": "{{params.qty}}" sends a string; write "qty": {{params.qty}} to send a number.
  • URL-encoding twice. Values in the URL are already encoded; do not pre-encode them.
  • Relying on the Content-Type of a GET. Bodies are ignored for GET requests.

Advanced

fillParams replaces {{params.path}} with encodeURIComponent in the URL and raw text elsewhere; interpolateSecrets then resolves {{secret.NAME}} and {{env.NAME}} (names in capitals, digits and underscores). Headers always include Accept: application/json, text/plain;q=0.8, */*;q=0.5 and User-Agent: MyAppBuilder-Runtime/1.0.

Related

Was this helpful?