Appearance
Update Metadata API
API Information
- Request Path:
/metadata/update - 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
UpdateMetaDataReq Object
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | Long | Yes | Metadata ID | Must be valid metadata ID |
| metadataName | String | No | Metadata name | Optional, maximum 50 characters |
| dataType | String | No | Data type | Optional, e.g., "RASTER", "VECTOR" |
| filePath | String | No | File path | Optional file path |
| fileSize | Long | No | File size | Optional file size in bytes |
| spatialReference | String | No | Spatial reference | Optional coordinate system |
| boundingBox | Object | No | Bounding box | Optional geographic bounds |
| resolution | Double | No | Resolution | Optional spatial resolution |
| bandCount | Integer | No | Band count | Optional number of bands |
| captureTime | String | No | Capture time | Optional timestamp |
Request Body Example
json
{
"id": 12345,
"metadataName": "Updated Satellite Image Metadata",
"dataType": "RASTER",
"filePath": "/data/satellite/updated_image001.tif",
"fileSize": 2048000,
"spatialReference": "EPSG:3857",
"boundingBox": {
"minX": 116.5,
"minY": 39.5,
"maxX": 117.5,
"maxY": 40.5
},
"resolution": 5.0,
"bandCount": 4,
"captureTime": "2024-01-02T10:00:00Z"
}Response Body Structure
CommonResponse Object
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Boolean | Update result, true indicates success |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": true
}Failure Response
json
{
"code": 404,
"message": "Metadata not found",
"data": false
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 404 | Metadata not found |
| 500 | Server internal error |
Usage Instructions
- This API is used to update existing metadata entries
- User authentication is required
- Metadata ID is required to identify which metadata to update
- Only metadata owners can update their metadata
- Returns boolean indicating update success
Notes
- Metadata ID is required and cannot be null
- Only fields that are provided will be updated
- User must have appropriate permissions to update the metadata
- User authentication token must be included in request headers