Appearance
Insert AOI API
API Information
- Request Path:
/aoi/insert/aoi - Request Method:
POST - Content-Type:
application/json
Request Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | String | Yes | User authentication token |
| Content-Type | String | Yes | Must be set to application/json |
Request Body Structure
AddAoiReq Object
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| geoAoi | String | Yes | Geometry in WKT format | Must be valid WKT geometry |
| name | String | Yes | AOI name | Cannot be empty |
| area | String | No | Area value | Optional |
| lngLat | String | No | Longitude and latitude coordinates | Optional coordinate string |
Request Body Example
json
{
"geoAoi": "POLYGON((121.0 30.5, 122.0 30.5, 122.0 31.5, 121.0 31.5, 121.0 30.5))",
"name": "Shanghai Coastal Area",
"area": "12345.67",
"lngLat": "121.5,31.0"
}Response Body Structure
CommonResponse Object
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Long | Created AOI ID |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": 12345
}Failure Response
json
{
"code": 400,
"message": "Invalid geometry format",
"data": null
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 500 | Server internal error |
Usage Instructions
- This API is used to create a new Area of Interest (AOI)
- User authentication is required
- AOI name and geometry are required
- Returns the ID of the created AOI
Notes
- AOI name is required and must be unique for the user
- Geometry must be in valid WKT (Well-Known Text) format
- Bounding box coordinates must be valid
- User authentication token must be included in request headers