For saved endpoints, you can add pre- and post-processors to prepare data or test the endpoint. Assertions are a type of post-processor in Apidog that allow you to validate API responses.
Click on the Post Processors tab.π· Visual Reference
2
Click on Add PostProcessor and select Assertion.
3
Fill in the Assertion form with the validation details. For example, to assert that the response category id is positive:
Field
Value
Name
"id" is a positive integer
Target Object
Response JSON
JSONPath Expression
$.category.id
Assertion Rule
Greater than
Assertion Value
0
JSONPath is a query language for JSON, used to select and extract data from JSON documents. You can click on the π¨ icon in the JSONPath Expression field to visually extract any JSONPath expression.
4
Click Send, and you will see the Assertion result in the bottom right corner.π· Visual Reference
You can also write assertions or implement other operations using scripts by simply adding a "Custom script". Apidog is compatible with Postman scripts, which can run in Apidog without modification. Learn more about Scripts.