api_login
Authenticate API requests by calling a login endpoint, extracting the token from the JSON response, and storing it in default headers for subsequent calls.
Instructions
Call a login endpoint, extract a token from the JSON response via tokenPath (dot path, e.g. "data.token"), and store it into defaultHeaders for all subsequent api_request/api_assert calls. Fails loudly if the token path is not found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Login endpoint, absolute or relative to baseUrl | |
| body | No | Login credentials, e.g. {username, password} | |
| method | No | ||
| tokenPath | No | Default "token" | |
| headerName | No | Default "Authorization" | |
| headerPrefix | No | Default "Bearer " |