📄 Contents
What is Apidog Why Apidog API Designers: Specify APls Back-end Developers: API Developing & Debugging Front-end Developers: API Mocking QA Engineers: APl Testing API Designers & API Consumers: APl Documentations Best Practice

Import in an Apidog project.
URL Import, paste the following URL and click Submit.https://petstore.swagger.io/v2/swagger.json
Confirm to import.

New API to create an endpoint.
/users/{id}Get user by id
Request part is finished.Responses part. In the 'OK(200)' response, change the field type of the root node to 'Refs Model - Schemas - ApiResponse'.



Response Examples part. Click Add Example.
Generate Automatically, and the response data will be generated according to the response structure. Click OK to add the example.
Save to finish the API specification. You'll get a well-designed API.
Generate Code on the API page and select Generate Server Stubs & Client SDKs.

Run button to enter the Run tab.

Manage Environments button at the top right.
https://mock.apidog.com/m1/352945-0-default

Send to send the request. The response of the API will be displayed below.
Send the request.

Save APICase to save the request. The requests will be saved as children of the API and can be referenced in the testing module.


Userid, and fill the Current Value with '1'. Save the Variable.
Response - Actual Request to see the request URL, and you'll find the {{Userid}} is replaced by the current value.
Pre Processors tab, and click the Add PreProcessor button. Add a Custom Script.
Custom Script area.
Custom Script before the Variable Substitution operation. Send the request.


API tab and click Local Mock. Click the URL & Params of 'OK(200)' to copy to the clipboard.
Smart Mock feature of Apidog.
Edit tab and Dereference the 'ApiResponse' Schema in the Response Part.
Mock value into the nodes, and Save the API.200JSONSuccess

Faker.js is also supported in the mock settings. You can select any Faker.js grammar to generate dynamic mock data.
Settings - Feature Settings - Mock Settings - Default Mock Type, and switch to Response Example First. Then Apidog mock engine will use the API response example as the mock response.
Get user by id - Success, switch to Post Processors and Add PostProcessor - Assertion.

Send the request, and you'll see the Assertion Result.
Extract Variable, Custom Script, Public Script, Database Operation, and Wait can also be added to Post Processors.
Testing module. Create a New Test Case.

Add Step and select Import from API Cases.

Run to execute the test case. Then you'll see a test report, and the details of each request.

More to see what went wrong with the failed API and compare the response with the assertions to locate the problem.

Dynamic Value feature to automatically generate variable values.Test Data switch, and click Manage Data.

Save and Run, and the values of the variables will be used in the iterations of the test case.

Detail of the API case, and click the 🪄(magic wand) button to open the Dynamic Value dialogue.

Datatype - number, and you'll see a preview of the dynamic value. Click Insert to apply the dynamic value.
Actual Request. Each time the request is sent, the dynamic value will generate a new value.

apidog run to get a command line test report. This command can also be used in Jenkins for implementing CI/CD.
Learn More to install Apidog CLI.
Share module, and +New a share.


Try it out on the shared website.

Code Samples feature supports generating API request code in dozens of languages, allowing API readers to directly call the API with the generated code.
Code Generation in the Responses also supports generating code for the structure of the response data, supporting several dozens of languages. API consumers can use the generated code in their implementation.

Custom domain, Top Navigation, Catalog Style, Content Footer, and more custom features are also supported in the documentation.