Skip to content

Pre-upload API ​

API Information ​

  • Request Path: /datafile/file/pre-upload/:type
  • Request Method: POST
  • Content-Type: application/json

Path Parameters ​

ParameterTypeRequiredDescription
typeStringYesraster/vector/model/other/bim/pointcloud/document

Request Headers ​

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

Request Body Structure ​

UploadReq ​

FieldTypeRequiredDescriptionConstraints
uploadMethodIntegerYesUpload method (0-local file, 1-online link)Must be 0 or 1
linkStringNoFile link (if uploadMethod=1)Required when uploadMethod=1
fileNameStringYesFile nameMust not be blank
extensionStringYesFile extensionMust not be blank
parentIdLongYesParent directory IDUse -1 for root directory
categoryIntegerYesFile category1-Satellite, 2-UAV, 3-Other
fileSizeDoubleYesFile sizeOptional file size
captureTimeLongNoCapture timestampOptional capture time(unit: s)
cloudOverDoubleNoCloud coverageOptional cloud coverage
sensorIntegerNoSensor typeOptional sensor type
imageLevelStringNoImage levelOptional image level

Request Body Example ​

json
{
    "uploadMethod": 0,
    "fileName": "test001",
    "extension": "tif",
    "parentId": -1,
    "category": 1,
    "fileSize": 0.0006453590467572212,
    "captureTime": 1763723619
}

Response Body Structure ​

CommonResponse Object ​

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataUploadDataFileRespPre-upload response

UploadDataFileResp Object (Nested in CommonResponse) ​

FieldTypeDescription
uploadUrlStringUpload URL, Use this url to upload
accountNameStringAccount name
containerStringContainer name
dataTypeIntegerData type (0-Raster, 1-Vector, 2-3D Model, 3-Other, 4-BIM, 5-Point Cloud, 6-Document)
fileIdStringFile unique ID, All the parameters below are used to be passed to the upload-success interface
fileSizeDoubleFile size
fileNameStringFile name
extensionStringFile extension
parentIdLongParent directory ID
categoryIntegerFile category
uploadMethodIntegerUpload method

Response Examples ​

Success Response ​

json
{
  "code": 200,
  "message": "OK",
  "data": {
    "fileId": "2JX0JS0JI",
    "fileSize": 6.453590467572212E-4,
    "fileName": "test001",
    "extension": "tif",
    "parentId": 706,
    "category": 1,
    "uploadMethod": 0,
    "container": "eo-qa",
    "accountName": "eopocstorage",
    "uploadUrl": "https://eopocstorage.blob.core.windows.net/eo-qa/data_test%2FRaster%2F2025%2F11%2F21%2F2JX0JS0JI_1763724701%2F2JX0JS0JI_1763724701.tif?sv=2023-11-03&se=2025-11-21T12%3A31%3A41Z&sr=b&sp=cw&sig=aOJ%2BT4MoMYMbZuw20r81GB4vnpHKXwwJqAMga%2BV2Fq4%3D"
  }
}

Failure Response ​

json
{
  "code": 400,
  "message": "Invalid file parameters",
  "data": null
}

Error Code Description ​

Error CodeDescription
200Success
400Request parameter error
401Unauthorized
500Server internal error

Usage Instructions ​

  1. This API is used to prepare for file upload
  2. User authentication is required
  3. File metadata must be provided
  4. Returns pre-signed upload URL and parameters

Notes ​

  • File name and size are required
  • Parent ID must reference an existing directory
  • Special users are restricted from using this API
  • User authentication token must be included in request headers