Appearance
Edit File API
API Information
- Request Path:
/datafile/file/edit - 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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | Long | Yes | File ID | Must exist |
| name | String | No | File/folder name | - |
| parentId | Long | No | Parent directory ID | -1 for root directory |
Request Body Example
json
{
"id": 12345,
"name": "updated_satellite_image.tif",
"parentId": 67890
}Response Body
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Boolean | Edit result, true indicates success |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": true
}Failure Response
json
{
"code": 404,
"message": "File not found",
"data": false
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 404 | File not found |
| 500 | Server internal error |
Usage Instructions
- This API is used to edit file properties
- User authentication is required
- File ID is required to identify which file to edit
- Returns boolean indicating edit success
Notes
- File ID is required and cannot be null
- Only fields that are provided will be updated
- User authentication token must be included in request headers