Pre-upload File Chunks
Pre-upload file chunks to obtain file upload credentials and upload address. When uploading large files, call this API first to get the OSS upload credentials before uploading file chunks.
Interface Address:
text
/papi/file/upload/preUploadRequest Method:
text
POSTContent-Type:
text
application/jsonHeader Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Access-Key | string | Yes | API access key ID. See API Rules for authentication |
| X-Signature | string | Yes | Signature value, Base64-encoded HMAC-SHA256 hash |
| X-Timestamp | string | Yes | Millisecond Unix timestamp (13 digits) |
| X-Nonce | string | Yes | Random string, 10-32 lowercase alphanumeric characters |
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| md5 | string | Yes | File MD5 value |
| fileName | string | Yes | File name |
| totalChunks | integer | Yes | Total number of chunks |
| fileSuffix | string | Yes | File suffix (including dot, e.g., .jpg) |
| totalSize | integer | Yes | Total file size |
| androidVersions | array[integer] | No | Android version list |
| platform | string | No | Platform initiating the request (see PlatformEnum) |
| module | string | No | Upload module (app: app store, drive: cloud disk) |
Request Example:
json
{
"md5": "892aaba56fad8c9c6de6d14c8faba767",
"fileName": "maomao2.3.4",
"totalChunks": 1,
"fileSuffix": ".apk",
"totalSize": 1,
"androidVersions": [0],
"platform": "string",
"module": "string"
}Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| code | integer | Error code. See Error Codes |
| data | object | Response data |
| ├─ status | integer | Pre-upload status (0: file pending upload, 1: file uploaded successfully) |
| ├─ url | string | File URL (image thumbnail URL) |
| ├─ appName | string | Application name |
| ├─ version | string | Application version |
| ├─ packageName | string | Application package name |
| ├─ logo | string | Application logo (image URL) |
| ├─ token | string | OSS service request token |
| ├─ uploadUrl | string | OSS service request URL |
| msg | string | Error message |
Response Example:
json
{
"code": 0,
"data": {
"status": 0,
"url": "",
"appName": "",
"version": "",
"packageName": "",
"logo": "",
"token": "",
"uploadUrl": ""
},
"msg": ""
}