Skip to content

Insert AOI API

API Information

  • Request Path: /aoi/insert/aoi
  • Request Method: POST
  • Content-Type: application/json

Request Headers

ParameterTypeRequiredDescription
AuthorizationStringYesUser authentication token
Content-TypeStringYesMust be set to application/json

Request Body Structure

AddAoiReq Object

FieldTypeRequiredDescriptionConstraints
geoAoiStringYesGeometry in WKT formatMust be valid WKT geometry
nameStringYesAOI nameCannot be empty
areaStringNoArea valueOptional
lngLatStringNoLongitude and latitude coordinatesOptional 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

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataLongCreated 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 CodeDescription
200Success
400Request parameter error
401Unauthorized
500Server internal error

Usage Instructions

  1. This API is used to create a new Area of Interest (AOI)
  2. User authentication is required
  3. AOI name and geometry are required
  4. 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