Skip to main content

Sending API Requests

In this section, you will learn how to send API requests by using Apidog.

After the API documentation is completed, you can start debugging your APIs.

TIP

Apidog, in contrast to Postman, makes a distinction between the ideas of API design and API execution.

  • API design: The New API page and the API Detailed Settings page are designed for defining API documentation instead of executing the API. Therefore, these pages can only be used to define the basic information of the API (parameter names and parameter descriptions, etc.) instead of set parameter values. Please set parameter value, PreProcessor script, PostProcessor script, etc. on the API execution page.

  • API execution: The API execution page (accessed from API Detailed Settings page) is designed for temporary debugging. After execution, click on save as a use case to save parameters, pre-processor scripts, post-processor scripts, etc. Otherwise, the information will be lost after closing the tab.

Getting Started

Go to API detailed settings, and click on the Run tab.

Save as Use Case

Save as a use case is to save the current settings for later use or to help others debug the API. After saving a use case, API use cases will be displayed in the tree menu on the left-hand side.

Please be aware:
  • API use cases are beneficial. It is recommended for developers to re-use them for debugging purposes.

  • An API typically has numerous use cases, such as the parameter's use case being correct, empty, different, etc.

API Parameters

The API paths,parameter names and values are automatically read from the API design during execution without requiring manual input but values have that option if necessary.

After filling in the parameters, click on Send to run.

Return Response

The system uses a return response to determine whether the data returned complies with the response specified in the data structure. It is more efficient and accurate, and it eliminates manual review.

Data Structure Verification Results.

The system automatically checks to see if the data returned after the run is accurate and provides a detailed error based on the data structure of the selected return response.

Assertions

The post-processor supports assertions. You can set assertions on the data (or response time) returned by the API to determine if it meets expectations. View more about assertions here.

Extracting Value for Variables

In post-processor you can extract data from the API returned response and set them to variables (local variables/environment variables/global variables), which can be used directly by other API. View the documentation of the extracting values for variables here.

Console

The console is designed to aid debugging. The console displays debugging log and error information of a script during runtime.

Content Preview

The response area can display content in basic formats such as JSON, XML, HTML, and TEXT. It also supports previewing image, PDF, and video files. Apidog automatically recognizes content types from the Content-Type in the response header and parses them correctly.

Image File Preview

PDF File Preview

Video File Preview

FAQ

You can check the FAQ:Sending API Requests if you encounter problems when sending API requests.