Appearance
Move File API
API Information
- Request Path:
/datafile/file/move - 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 |
|---|---|---|---|---|
| sourceFileId | Long | Yes | Source file ID | Must exist |
| targetParentId | Long | Yes | Target parent directory ID | Must exist |
Request Body Example
json
{
"sourceFileId": 12345,
"targetParentId": 67890
}Response Body
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | Boolean | Move result, true indicates success |
Response Examples
Success Response
json
{
"code": 200,
"message": "success",
"data": true
}Failure Response
json
{
"code": 404,
"message": "Source file not found",
"data": false
}Error Code Description
| Error Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 404 | Source file not found |
| 500 | Server internal error |
Usage Instructions
- This API is used to move a file to a new location
- User authentication is required
- Source file ID and target parent ID must be provided
- Returns boolean indicating move success
Notes
- Source file ID must reference an existing file
- Target parent ID must reference an existing directory
- Moves the file to the new location (changes parent directory)
- User authentication token must be included in request headers