API Management
Definition
This module is used to centrally manage internal and external API services on the platform. It supports quickly creating Data Services APIs through a graphical wizard or SQL writing, and provides capabilities such as service forwarding and geospatial service support to meet diverse data opening and sharing needs.
API Creation Modes
- 🧭 Wizard Configuration: guides users through data source selection, field configuration, output format, permission settings, and more through a graphical process. APIs can be created quickly without writing code;
- 💻 SQL Mode: supports users directly writing SQL query statements to build Data Services, applicable to complex business logic and flexible data extraction;
- 📌 Supplementary Attributes: supports setting supplementary information such as API update cycle, update time, service description, and access permissions for service management and monitoring.
Third-party Service Forwarding and Access
- 🌐 General Service Forwarding: supports accessing and forwarding third-party APIs developed by downstream regional basin organizations;
Notes
Before publishing an API, confirm data source permissions and sensitive field handling. For third-party forwarding services, we recommend configuring rate limiting and authentication policies to avoid API abuse or leakage.
Scope
Applicable to external service encapsulation of data in the platform, unified access and forwarding of third-party system services, integration management of geographic and video services, and other scenarios. It enables service-based output and unified invocation of government, industry, and enterprise data.
1. API Management Page
Click Data Services under API Management to open the API Management page. The page is divided into left and right sides: the left side displays API service categories in a tree structure, and the right side displays a list including API name, API Category, API version, API path, and other fields.

2. Add API Service
Click Add, fill in the API service information in the dialog, and click OK to complete adding the API service information.

2.1. Attribute Configuration
Open the Add API Service page. In the Attribute Configuration module, fill in related information such as API name and API version, then click Next to open the Parameter Configuration Page.

2.2. Parameter Configuration
Open the Parameter Configuration page, select a configuration method, and fill in parameter information. Data source configuration includes three methods: single-table wizard, SQL script, and third-party forwarding. Then click Next to open the Test page.

2.3. Test
Open the Test page, enter parameter values, and click API Invocation. The system will return the test result. After completion, click Save and Exit.


3. Edit API Service
Select the API service to edit, click Edit in the operation column, edit the existing API service information on the page that appears, and click Save and Exit after editing to complete editing the API service information.



4. Delete API Service
Select the API service to delete, click Delete in the operation column, and click OK in the dialog to complete deleting the API service.

5. API Service Details
Select the API service whose details need to be viewed, click Details in the operation column, and view API service details on the page that appears.


6. Enable/Disable
Select the API service to enable or disable, and click the switch in the status column to complete Enable/Disable.

7. Service API Authentication
7.1 Background
The system provides unified API access capabilities in Data Services. The caller must first obtain an access token through the application authentication API, and then carry the token to access business APIs.
7.2 Obtain the Application Key
- The administrator creates or assigns an application for the specified personnel in Basic Management → Application Management.
- Each application generates a unique credential set:
- client_id: application identifier
- client_secret: application key
- The application key (client_secret) is usually visible on the administrator interface, and the administrator copies and assigns it to the corresponding user.
⚠️ Note:
client_secretis sensitive information. Users should keep it properly. If it is leaked, contact the administrator immediately to reset it.
7.3 Obtain Token
API Information
- API Path:
POST http://127.0.0.1:8080/prod-api/oauth2/client_token - Description: obtains an access token through
client_idandclient_secret
Request Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| grant_type | string | Yes | Fixed value client_credentials, indicating client mode |
| client_id | string | Yes | Application ID |
| client_secret | string | Yes | Application key |
| scope | string | No | Optional parameter, used for API access scope control |
Response Parameters
| Field Name | Type | Description |
|---|---|---|
| code | integer | Status code. 200 indicates success; 500 indicates failure |
| msg | string | Return message description |
| data | null | Reserved field |
| token_type | string | Token type, generally bearer |
| client_token | string | Access token, used when invoking APIs |
| expires_in | integer | Token validity period, in seconds |
| client_id | string | Returned application ID |
| scope | string | Scope of the token |
7.4 Use Token to Invoke Business APIs
After successfully obtaining client_token, it must be carried in the request parameters when invoking business APIs.
- Example URL
http://127.0.0.1:8080/prod-api/services/v1.0.1/getDaDiscoveryTaskDO