Testing HTTP transactions in sandbox.
Use this for HTTP transaction verification, or to re-test an existing transaction after update.
MESSAGING transactions are not supported in sandbox.
IMPORTANT: Testing a transaction in the sandbox ALWAYS requires two sequential tool calls:
1. Call `init` first — places the transaction into the sandbox environment.
2. Then call `test_request` — sends the actual HTTP request and returns the match result.
Both steps are mandatory. Calling only `init` does NOT test anything; you MUST follow it with `test_request`.
Response fields: matched=true means the request was matched by the configured transaction.
matched=false means no transaction matched — read mismatch_reasons to understand which
matchers failed and what to fix in the DSL.
Actions:
- init: Places transaction into sandbox. Must be called BEFORE test_request.
args(dict): Dictionary with the following required parameters:
workspace_id (int): Mandatory. The id of the workspace.
transaction_id (int): Mandatory. The id of the transaction to test.
- test_request: Sends test request to sandbox and returns match result. Must be called AFTER init.
args(dict): Dictionary with the following required parameters:
request (SandboxRequest): Mandatory. The request definition (method, path, headers, body).
workspace_id (int): Mandatory. The id of the workspace.
Sandbox Request Schema:
{'$defs': {'HttpHeader': {'additionalProperties': True, 'properties': {'name': {'description': 'HTTP header name', 'title': 'Name', 'type': 'string'}, 'value': {'description': 'HTTP header value', 'title': 'Value', 'type': 'string'}}, 'required': ['name', 'value'], 'title': 'HttpHeader', 'type': 'object'}, 'QueryParameter': {'additionalProperties': True, 'properties': {'name': {'description': 'Query parameter name', 'title': 'Name', 'type': 'string'}, 'value': {'description': 'Query parameter value', 'title': 'Value', 'type': 'string'}}, 'required': ['name', 'value'], 'title': 'QueryParameter', 'type': 'object'}}, 'properties': {'method': {'description': 'The http method', 'title': 'Method', 'type': 'string'}, 'path': {'description': 'The request url path', 'title': 'Path', 'type': 'string'}, 'name': {'description': 'The name of the service', 'title': 'Name', 'type': 'string'}, 'queryParameters': {'anyOf': [{'items': {'$ref': '#/$defs/QueryParameter'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of query parameters', 'title': 'Queryparameters'}, 'headers': {'anyOf': [{'items': {'$ref': '#/$defs/HttpHeader'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of response headers', 'title': 'Headers'}, 'content': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Base64 encoded body of the response', 'title': 'Content'}}, 'required': ['method', 'path', 'name'], 'title': 'SandboxRequest', 'type': 'object'}
Sandbox test_request response schema:
{'$defs': {'HttpHeader': {'additionalProperties': True, 'properties': {'name': {'description': 'HTTP header name', 'title': 'Name', 'type': 'string'}, 'value': {'description': 'HTTP header value', 'title': 'Value', 'type': 'string'}}, 'required': ['name', 'value'], 'title': 'HttpHeader', 'type': 'object'}, 'MatchingLogEntry': {'additionalProperties': True, 'properties': {'t': {'default': None, 'description': 'Timestamp of when the message was logged (in milliseconds since epoch)', 'title': 'T', 'type': 'integer'}, 'm': {'default': None, 'description': 'Log message', 'title': 'M', 'type': 'string'}}, 'title': 'MatchingLogEntry', 'type': 'object'}}, 'properties': {'status': {'description': 'HTTP status code of the response for the transaction response matching. E.g., 200, 404.', 'title': 'Status', 'type': 'integer'}, 'statusMessage': {'description': 'HTTP status message of the response', 'title': 'Statusmessage', 'type': 'string'}, 'headers': {'anyOf': [{'items': {'$ref': '#/$defs/HttpHeader'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'List of response headers', 'title': 'Headers'}, 'body': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'description': 'Decoded response body (plain text or JSON). Empty when no transaction matched.', 'title': 'Body'}, 'matchingLog': {'anyOf': [{'items': {'$ref': '#/$defs/MatchingLogEntry'}, 'type': 'array'}, {'type': 'null'}], 'default': [], 'description': 'Raw matching log entries from WireMock, used for debugging.', 'title': 'Matchinglog'}, 'matched': {'default': False, 'description': 'True when the request was matched by a transaction (matchingLog is empty). False means no transaction matched — check mismatch_reasons.', 'title': 'Matched', 'type': 'boolean'}, 'mismatch_reasons': {'description': 'Plain-text reasons why the request did not match any transaction. Populated from matchingLog when matched=False.', 'items': {'type': 'string'}, 'title': 'Mismatch Reasons', 'type': 'array'}}, 'required': ['status', 'statusMessage'], 'title': 'SandboxResponse', 'type': 'object'}