Skip to content

Move File API

API Information

  • Request Path: /datafile/file/move
  • Request Method: POST
  • Content-Type: application/json

Request Headers

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

Request Body Structure

FieldTypeRequiredDescriptionConstraints
sourceFileIdLongYesSource file IDMust exist
targetParentIdLongYesTarget parent directory IDMust exist

Request Body Example

json
{
  "sourceFileId": 12345,
  "targetParentId": 67890
}

Response Body

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataBooleanMove 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 CodeDescription
200Success
400Request parameter error
401Unauthorized
404Source file not found
500Server internal error

Usage Instructions

  1. This API is used to move a file to a new location
  2. User authentication is required
  3. Source file ID and target parent ID must be provided
  4. 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