Introduction
In this section, you will learn how to share API documentation online rapidly and easily.
In API development, communication, and collaboration, API documentation is logically the standard, but in practice, there is the problem of passing around files in Word or PDF formats. For this reason, online document
is advocated to improve the efficiency of communication between teams.
Sharing Online Documents
In the API, Share Docs
for the current project can be set on the left side.
Click on "New" and set the information content according to your needs:
Document Language
Access Password
Date of Sharing Online Documents
Sharing Scope: You can choose the entire project, select specific APIs, or import them based on tag dimensions.
Operating Environment: You can select the operating environment and display the corresponding URL. After selection, the shared online API documentation supports running and debugging.
The person in charge of the API documentation, modification time, and corresponding URL can be displayed.
Share the Entire Directory
The online document supports share the entire directory
. Select the corresponding group to open the entire directory sharing, and the group will automatically synchronize to the online document after modification. Of course, if you do not want the online document to synchronize your modifications in real time, you can choose not to enable it.
After the setting is complete, copy the link to share with team members.
View Online Documents
During the Online document
process, copying API URLs
, data It is recommended that
, and return example fields
are supported.
Online API Documentation Supports Running and Debugging
When setting up online sharing
, the environment needs to be set (cloud mock
is recommended).
Not only does online documentation support online running and debugging, but also many open documents in API Hub support it, which facilitates debugging and use, further improving development and docking efficiency.
Online Documents Support Modifying Environment Variables
When setting uponline sharing
, the environment where the API refers to environment variables
need to be set.
When debugging the online document API, there will be a scenario of modifying the environment variables referred to by the API documentation. Now, according to the figure below, the environment variables can be modified, and then run for debugging.
Exporting APIs from Online Documentation
After the administrator enables the "Allow Export Data" button in the "Publish Settings", any user with permission to access the online documentation can directly export API data on the web page.
Other users open the online documentation link and click the "Export" button in the lower right corner to export the current API documentation in Apidog
, OpenAPI(Swagger)
, HTML
or Markdown
format.
It is recommended for Apidog users to directly select to "Clone" the API documentation to their own project.
Online Documents Support Displaying Sample Code
The shared Online API document
supports displaying sample code, and so does API Hub. You can directly copy the current API's code for immediate use.
Difference Between Sharing and Publishing API Documention
Sharing Documention
The main purpose of custom share is for quick sharing within a small group. Each project can have multiple shares, and each share can have different content and permissions.
Publishing Documention
Publish is mainly used for exposing APls to the public. Each project can only have one publish, which supports custom domains, page layout settings (such as navigation menu layout), and theme customization.
Apidog Link URL Specification
Link Address
WEB Version | Project Address | https://app.apidog.com/project/{Project-ID} |
Specified API in the project-document tab | https://app.apidog.com/project/{Project-ID}/apis/api-{API-ID} | |
Specified API in the project-run tab | https://app.apidog.com/project/{Project-ID}/apis/api-{API-ID}-run | |
Online documentation (public project) | Document homepage | https://apidog.com/apidoc/project-{Project-ID} |
Specified API in the document | https://apidog.com/apidoc/project-{Project-ID}/api-{API-ID} | |
Specified API in the document-automatically open the "run" module | https://apidog.com/apidoc/project-{Project-ID}/api-{API-ID}-run |
Pass Environment Variables
Function: Set the user's "environment variables" automatically by passing parameters.
Usage: Add URL parameters environment[variable name
]=variable value
. Example:
WEB Version Project:
- https://app.apidog.com/project/406014?environment[aaa]=xxx&environment[bbb]=yyy
- https://app.apidog.com/project/406014/apis/api-10061199-run?environment[aaa]=xxx
Online Documents:
- https://apidog.com/apidoc/project-406014?environment[aaa]=xxx&environment[bbb]=yyy
- https://apidog.com/apidoc/project-406014/apis/api-10061199-run?environment[aaa]=xxx
Pass request parameters
Function: Set the "API parameters" of the "run" module (only applicable to specified API addresses) and run tabs within the project.
Simple mode:
"Simple mode" does not support scenarios where parameter names include square brackets. In this case, please use "Advanced mode."
- Pass parameters via URL on the WEB running API:https://app.apidog.com/project/406014/apis/api-10061199-run?query[aaa]=yyy&query[bbb]=yyy&path[aaa]=yyy&body[aaa]=yyy&header[aaa]=yyy&cookie[aaa]=yyy&environment[aaa]=yyy
- https://apidog.com/apidoc/project-406014/api-10061199-run?query[aaa]=yyy&query[bbb]=yyy&path[aaa]=yyy&body[aaa]=yyy&header[aaa]=yyy&cookie[aaa]=yyy&environment[aaa]=yyy
Parameter Type | Parameter Value | Remarks |
---|---|---|
Query Params | query[xxx]=yyy | |
Path Params | path[xxx]=yyy | |
Body Params | body[xxx]=yyy | Body Types include formdata or x-www-urlencoded |
Body Params | body=yyy | Other Body Types |
Header Params | header[xxx]=yyy | |
Cookie Params | cookie[xxx]=yyy | |
Environment Variables | environment[xxx]=yyy | It will save to the environment variables of the default environment. |
Advanced Mode:
WEB run API, Passing parameters by URL:
https://app.apidog.com/project/406014/apis/api-10061199-run?params={ "query"%3A{ "aaa"%3A"xxx"%2C "bbb"%3A"yyy" }%2C "body"%3A{ "aaa"%3A"xxx"%2C "bbb"%3A"yyy" }%2C "cookie"%3A{ "aaa"%3A"xxx"%2C "bbb"%3A"yyy" }%2C "environment"%3A{ "aaa"%3A"xxx"%2C "bbb"%3A"yyy" } }
The value of params
is obtained by encodeURIComponent on the following JSON data.
JSON
{
"query": [
["id", "value1"],
["id", "value2"],
["key2", "value3"]
],
"path": [
["key1", "value1"],
["key2", "value2"]
],
"body": [
["aaa", "value1"],
["key2", "value2"]
],
"header": [
["testHeader", "value1"],
["key2", "value2"]
],
"cookie": [
["testCookie", "value1"],
["key2", "value2"]
],
"environment": [
["key1", "value1"],
["key2", "value2"]
]
}
Parameters Type | Parameters Value | Remarks |
---|---|---|
Query Params | query | |
Path Params | path | |
Body Params | body | If the body type is formdata or x-www-urlencoded, the value of body is json; otherwise the value of body is string |
Header Params | header | |
Cookie Params | cookie | |
Environment Variables | environment | It will save to the environment variables of the default environment. |