API Modelling – The API actions
As you become familiar with JOSF, you will notice that all actions available for your test scripts, page interactions, and the Post action steps of API requests are located in the test-step drawer on the right side of the screen.
From version 3.3.0 onward, JOSF includes a set of twelve API actions that can be used to verify and extract data from your API requests. These actions enable deeper and more reliable validation of your application by checking both response and request data directly within your test flow. Before you start using them, make sure you have set up your API host as described in the “Start with API Modelling” tutorial. The API actions can be applied to executed API requests or to recorded browser network data, allowing coverage of your backend communication. See network scan action tutorial click here: Tutorial.
Sidenote 1: In our examples, we frequently use JSONPath and XPath techniques. These are designed to identify a single object from your JSON or XML response. JSONPath is used for querying JSON data, while XPath is used for navigating XML documents. Both methods help you efficiently extract specific data from these formats(see “API Modelling – Handy Tools” for extracting these paths).

Verify response time
Execution time
This action verifies the response time of the most recent API request in the test conetxt, measured in milliseconds. Specify the expected response time value in the Data field, along with an operator.
Configuration
Available operators are: =, >, <, >=, <=, !=, or ~. If you omit the operator, the verification will check for an exact match (equivalent to using the = operator).
Example

Verify node count
Amount of nodes
This verification returns the number of nodes/objects found based on the given JSON -/xpath provided in the Object field. The JSON-/xpath input is required; otherwise, you will encounter an error. The expected node count value is provided in the Data field with an operator.
Configuration
Available operators are: =, >, <, >=, <=, !=, or ~. If you omit the operator, the verification will check for an exact match (equivalent to using the = operator).

Verify node (not) present
Node (not) available
This verification checks if a node can be found based on the given JSON-/xpath provided in the Object field. The JSON-/xpath input is required; otherwise, you will encounter an error. This action does not require a value in the Data field.
If node not present action is used, then it will check for the opposite.
Configuration
You can verify the node presence on both the response and the sent request.
Example

Verify status code
Validate statuscode
This verification checks if the status code of the given response matches the expected value. The expected status code value is provided in the Data field with an operator. You can check the actual status code in the response viewer of the executed response step.

Configuration
Available operators are: =, >, <, >=, <=, !=, or ~. If you omit the operator, the verification will check for an exact match (equivalent to using the = operator).
Verify node value
Matching values
This verification checks if the value of a node matches the expected outcome based on the given JSON-/xpath provided in the Object field. The JSON-/xpath input is required; otherwise, you will encounter an error. The expected value is provided in the Data field.
Configuration
Available operators are: =, >, <, >=, <=, !=, or ~. If you omit the operator, the verification will check for an exact match (equivalent to using the = operator).
Flexible Matching mode
Turn this option on to make JSON comparison less strict. When enabled, JOSF will ignore the order of fields and allow extra or missing parts in the JSON. This option only applies when the expected value in the Data field is a JSON object. It’s useful when you want to validate the main content of a JSON response without failing the test because of small structural differences. Turn it off if you need an exact match.
Example

Set Content Type
Refresh the current page
This action sets the Content-Type header for the API response. Specify the desired Content-Type value (e.g., application/json, text/html, application/xml) in the Data field
Configuration
n/a – this sub action has no extra configuration

Extract node
Extract node from request/response
This action extracts the value of a specific node based on the given JSON-/xpath provided in the Object field. The extracted value is stored in the variable named in the Data field. Provide the JSON-/xpath to the desired node in the Object field. Enter the name of the variable where you want to store the extracted value in the Data field. This allows you to use the extracted node value in subsequent steps.
Example
Configuration
You can verify the node value on both the response and the request.

API Cookie
Extract cookie data
This action extracts various attributes of a cookie from the received API response or the sent request and stores the extracted value in a buffer variable. The cookie name is provided in the Object field, and the buffer variable name is provided in the Data field.
Provide the cookie name in the Object field and the buffer variable name in the Data field. This action has seven subsections for extracting different attributes of the cookie.
Configuration
- Toggle to extract the request cookie, instead of the response cookie on default this is not enabled.
Available subactions are: - Extract Value: Get the value of a cookie.
- Extract Domain: Get the domain of a cookie.
- Extract Path: Get the path of a cookie.
- Extract Expiry Date: Get the expiry date of a cookie.
- Extract Max Age: Get the max age of a cookie.
- Extract Http Only: Get the HttpOnly attribute of a cookie.Extract Secure: Get the Secure attribute of a cookie.
Extract header from response/request
Upload a file in your browser
This action extracts the value of a specified header from the API response or request and stores it in a buffer variable.The header key and buffer variable name are provided in the Data field.
Configuration
Enter the buffer variable name and the target header key in the Data field in the format bufferName=targetHeader. The action will search for the specified header key in the response headers, extract its value, and store it in the specified buffer variable. If the header is not found, an error will be raised.

Extract node count
Extract node count from request/response
This action counts how many nodes or objects are found based on the JSONPath or XPath provided in the Object field, and stores that number in a variable. The JSONPath/XPath input is required; if it’s missing or incorrect, the action will return an error. The result (the total node count) is saved in the variable name specified in the Data field. You can use this variable later in your test for validations or calculations.
Example

Configuration
- Object: JSONPath or XPath pointing to the nodes you want to count.
- Data: Name of the variable where the count will be stored.
