1. Docs
  2. Resources
  3. API Requests
  4. Edit and send

Edit and send a request

The middle and right panels of API Requests hold one request. This page explains each field, what Save and Send do, and how status, time and size are worked out.

6 min read Updated CustomersAdmins

In short

On this page you can

  • Set method, URL, body, params and headers of a request.
  • Choose Bearer Token, Basic Auth or inherit authorization from a collection.
  • Insert a Data Source key such as {{ds:apiBase}} into the URL.
  • Send the request and read status, time, size and body.
  • Know exactly what Send sends and what it leaves out.

How to use it

  1. Pick the HTTP method and type the Request URL.
  2. Fill Body, then Authorization and Header in Request settings.
  3. Click Save.
  4. Click Send and check the status chip and the body.
  5. If it fails, read the message in the response area and click Retry.

Method and URL#

FieldNotes
HTTP methodGET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS. See what Send sends and what a run sends: not every method is sent by both.
Request URLUp to 2,048 characters. May contain references such as {{ds:apiBase}}/orders/{{tc:orderId}}. Pasting a curl command fills the whole request; see Paste a curl command.
Data source picker (icon in the URL field)Inserts a Data Source key at the cursor. Tooltip “Data Sources - Global Parameters - Datasets”.
SendSends the request now and shows the response. “Sending...” while it runs.
SaveStores the request. “Saving...” while it runs, then “API data saved”.

Body#

  • Choose raw or form-data under Body.
  • raw: free text with a Body format for highlighting: JSON, Text, JavaScript, HTML, XML. The format does not set a header; add Content-Type yourself when the API needs something other than JSON.
  • form-data: rows of Key, Value, Description.
  • Use raw for requests you will run in tests: a run sends the raw body. See What a run does differently.
Example · raw JSON body with references
{
  "email": "{{ds:loginEmail}}",
  "productId": {{excel:products}}_id,
  "quantity": 1
}

Authorization#

Open Request settingsAuthorization and choose an Authorization type:

TypeFieldsAdds to the request
None—Nothing
Bearer TokenToken (“Enter your Bearer token...”). Accepts {{ds:apiToken}}; the picker icon inserts it.Authorization: Bearer <token>
Basic AuthUsername (up to 255 characters), Password (up to 128, Show password / Hide password)Authorization: Basic <base64 of user:password>
Inherit from parentShows “Inherited:” and the parent’s typeThe authorization of the nearest collection or folder above that has one

Token and password are stored encrypted, but everyone who opens the request can read them in these fields. Prefer a reference to an encrypted key.

Inherited authorization#

  1. Select the collection or folder

    Click it in the tree. The middle says “You can set default auth for this collection from the Authorization tab on the right panel…”.

  2. Set its authorization

    In Authorization, choose Bearer Token or Basic Auth and fill it: “This token will be inherited by all requests in this collection/folder”.

  3. Save Auth

    Click Save Auth.

    “Authorization saved.”

  4. Inherit in the requests

    In each request, choose Inherit from parent and save. If no parent has authorization: “No authorization set on parent collection/folder. Set it there first.”

Inheritance works on this page, not in runs

Send uses the inherited authorization. A test run does not apply Inherit from parent or Basic Auth. For requests you add to tests, use Bearer Token with {{ds:apiToken}}, or an Authorization header. See Authorization in runs.

Params and Header#

  • Both tabs hold rows of Key, Value, Description with Enable row and Delete row.
  • Rows that are switched off are left out when you save, so they are gone after a reload. Delete them, or keep a copy of the request with Duplicate.
  • Params are query parameters. Send on this page does not add them to the URL; a test run does. Keep the query in the URL when you want to try it here.
  • Header values accept references: X-Api-Key: {{ds:apiKey}}.

Save#

  • URL required: “URL is required. Please enter a request URL.”
  • Relative and templated URLs are allowed: /api/orders or {{ds:apiBase}}/orders can be saved; a test run fills in the references.
  • Data Source keys must lead to a real address: when the URL contains a Data Source key and the key’s value does not start with http:// or https://, saving shows “Invalid URL. Please enter the address starting with http:// or https://.”
  • Unsaved changes: selecting another item or leaving the page asks “Are you sure to exit without saving?” with Exit without saving, Cancel and Save and Exit.
  • The name is saved separately, as soon as you leave the name field.

What Send sends#

Send works on what is on the screen, saved or not. The request goes out from the SmartestQA server and has 30 seconds to answer.

PartSent as
URLData Source keys in the URL are replaced by their default value (not an environment variant). The result must start with http:// or https://. Other references such as {{tc:…}} stay as typed.
MethodPOST and PUT with the body, DELETE without a body. GET, PATCH, HEAD and OPTIONS are sent as GET.
HeadersThe rows that are switched on, plus Content-Type: application/json unless you set a Content-Type yourself. References in headers stay as typed.
ParamsNot added. Only the query already in the URL is sent.
Bodyraw: the text as typed. form-data: a JSON object made of the rows that are switched on.
AuthorizationBearer, Basic, or the inherited one. A reference in the token stays as typed.

To try a request with references and real values, use Send on its API step in Automate, which asks for test values, or a Dry Run. See Try the step.

Read the response#

  • Status chip: the code and its name, for example “201 Created”. Any status is a successful Send: 404 and 500 are answers too.
  • Time and size next to the chip; see below.
  • Response format: JSON (pretty-printed when the body is valid JSON), XML, HTML, Text, JavaScript. It changes the display only.
  • Errors appear in the response area under “Could not send the request”, with Retry for network errors. See Troubleshooting › Send.
  • Selecting another request or leaving the page cancels a request that is still running.

How status, time and size are worked out#

Status chip colourShown in: Response header
2xx → ok (green)   3xx → info (blue)   4xx → warning (amber)   5xx → error (red)

Example: 200 OK, 401 Unauthorized, 503 Service Unavailable. A 401 is shown in amber, not red: the API answered, but refused.

TimeShown in: Response header, in ms
time = moment the answer reached your browser − moment you clicked Send     (rounded to whole ms)

Example: the API needs 180 ms, the trip from the SmartestQA server to the API and back to your browser adds 132 ms: the chip shows 312 ms. It is not the API’s own response time; use it to compare, not to measure performance.

SizeShown in: Response header
bytes = length of the response body in UTF-8
size  = bytes "B"                       if bytes < 1,024
      = bytes ÷ 1,024 "KB"              1 decimal below 10 KB, whole above
      = bytes ÷ 1,048,576 "MB"          1 decimal

Example: a body of 1,250 bytes shows 1.2 KB; 52,000 bytes show 51 KB. Headers are not counted.

If something goes wrong#

Didn’t find your answer?Write to support with your project name and what you see on screen.

info@smartestqa.ai