Appearance
Pre-upload API
API Information
- Request Path:
/datafile/file/pre-upload/:type - Request Method:
POST - Content-Type:
application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | String | Yes | raster/vector/model/other/bim/pointcloud/document |
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
UploadReq
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| uploadMethod | Integer | Yes | Upload method (0-local file, 1-online link) | Must be 0 or 1 |
| link | String | No | File link (if uploadMethod=1) | Required when uploadMethod=1 |
| fileName | String | Yes | File name | Must not be blank |
| extension | String | Yes | File extension | Must not be blank |
| parentId | Long | Yes | Parent directory ID | Use -1 for root directory |
| category | Integer | Yes | File category | 1-Satellite, 2-UAV, 3-Other |
| fileSize | Double | Yes | File size | Optional file size |
| captureTime | Long | No | Capture timestamp | Optional capture time(unit: s) |
| cloudOver | Double | No | Cloud coverage | Optional cloud coverage |
| sensor | Integer | No | Sensor type | Optional sensor type |
| imageLevel | String | No | Image level | Optional 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
| Field | Type | Description |
|---|---|---|
| code | Integer | Response status code |
| message | String | Response message |
| data | UploadDataFileResp | Pre-upload response |
UploadDataFileResp Object (Nested in CommonResponse)
| Field | Type | Description |
|---|---|---|
| uploadUrl | String | Upload URL, Use this url to upload |
| accountName | String | Account name |
| container | String | Container name |
| dataType | Integer | Data type (0-Raster, 1-Vector, 2-3D Model, 3-Other, 4-BIM, 5-Point Cloud, 6-Document) |
| fileId | String | File unique ID, All the parameters below are used to be passed to the upload-success interface |
| fileSize | Double | File size |
| fileName | String | File name |
| extension | String | File extension |
| parentId | Long | Parent directory ID |
| category | Integer | File category |
| uploadMethod | Integer | Upload 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 Code | Description |
|---|---|
| 200 | Success |
| 400 | Request parameter error |
| 401 | Unauthorized |
| 500 | Server internal error |
Usage Instructions
- This API is used to prepare for file upload
- User authentication is required
- File metadata must be provided
- 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