Build API Docs with Apidog
  1. Advanced features
Build API Docs with Apidog
  • Overview
  • REST API Documentations
    • Basics
      • API-Design First Approach
      • Specify an endpoint
      • Components
      • Common parameters
      • Global parameters
      • Schemas
        • Overview
        • Create a new schema
        • Build a schema
        • Generate Schemas from JSON etc.
    • Advanced features
      • Custom endpoint fields
      • Endpoint status
      • Appearance of parameter lists
      • Endpoint unique idenfication
    • Example: Pet Store
      • Get user info
      • Find pet by ID
      • Add a new pet to the store
      • Update an existing pet
      • Deletes a pet
      • Finds Pets by status
  • SOAP API Documentations
    • How to Use Apidog to Write SOAP API Documentation
    • Example: WebService
      • WebService: Number To Words
      • SOAP: Add integers
      • SOAP/WSDL: Ebay
    • Example: Mastercard
      • Purchase Request
      • Submit a purchase request
  • GraphQL Documentation
    • How to Write GraphQL API Documentation Using Apidog
    • Example: Github
      • Introduction to GraphQL
      • Queries
      • Public schema
  • WebSocket Documentations
    • How to Use Apidog to Write WebSocket API Documentation
    • Example: Coinbase
      • Overview
      • Channel
  • SSE API Documentations
    • Example: Anthropic
      • Streaming Messages
      • Messages
  • gRPC API Documentations
    • How to Use Apidog for gRPC API Documentation and Testing
    • Example: Proto Documentation
      • Protocol Documentation
  1. Advanced features

Endpoint unique idenfication

Currently, most APIs are differentiated based on the method and path. However, some development projects (such as some e-commerce API documents) use a fixed URL for the API request and differentiate between APIs using parameters in the Query / Header.
After version 2.2.9, Apidog added the endpoint unique Identification feature, which supports OperationId, Query parameters, Body parameters, and Header parameters as parameters to differentiate between APIs.

1. Setting endpoint unique identification#

Endpoint unique ID is defined as a set of the directory level. When you need to set an API as a unique identification, you need to set it in its parent directory. Click on the directory and choose the unique identification parameter according to your needs, and after clicking save it will take effect on all APIs under that directory.
CleanShot 2024-11-27 at 16.31.22@2x.png
For this example we will choose Query parameter and write 'OperationiId' inside param name.

2. Fill in the corresponding Parameter Value for the Unique Identifier#

After setting the endpoint unique Identification for the directory, click on an API under that directory, click the operationid tab, and in both the basic information and request parameters at the bottom of the API, there is an icon of K, which represents the parameter for the endpoint unique ID.
CleanShot 2024-11-27 at 16.32.40@2x.png
You can enter the corresponding value under the corresponding parameter as the value for the endpoint unique Identification.

3. Import#

If you use parameters in Query/Header to distinguish between APIs in your project and import an OpenFormatted file into Apidog, the following page will appear.
The rule for matching APIs during import is subject to the settings of the target directory. If the setting of the endpoint unique Identification in the target directory does not meet the requirements, you can modify it in the import settings. After modification, it will take effect directly on the target directory
As an example we will import this directory and create endpoint unique ID for it with Query Param and Param Name for it called 'action'.
CleanShot 2024-11-27 at 16.45.30@2x.png
Remember if your directory alredy has unqiue ID,the new import can't overwrite it.
CleanShot 2024-11-27 at 16.36.28@2x.png
CleanShot 2024-11-27 at 16.50.56@2x.png
1.
Users who have used the Fixed Value in Query parameters need not worry because this function will still be retained. However, when importing, the Fixed Value is judged based on the URL, so it is recommended that users who have used the Fixed Value use the endpoint unique Identification.
2.
The endpoint unique Identification supports setting multiple parameters.
3.
If only a subdirectory in your directory is set as the endpoint unique Identification, when importing Swagger and updating all directories, please avoid importing all projects to the root directory for updating. It is recommended to import APIs set as endpoint unique Identification separately into that special.

4. Mock Data#

Starting from version 2.2.24, if the API has set the unique identifier as Body Parameter or Header Parameter, you need to send the path + parameter name and value of the unique identifier to get the corresponding Mock Data.
1.
When accessing Mock Data during development, frontend developers also need to send the path + parameter name and value of the unique identifier if the API has set the unique identifier as Body Parameter or Header Parameter.
2.
For projects that have a unique identifier for APIs, the API documentation needs to be standardized to avoid cases where APIs have the same URL but do not have a unique identifier set. This is to avoid the failure of obtaining Mock Data correctly.
Previous
Appearance of parameter lists
Next
Example: Pet Store
Built with