UploadFile
Host: dip-cb.binanceapi.com
POST /mp-api/v1/apps/{appId}/files/upload
Header
Parameter | Required | Description |
---|---|---|
X-Mp-Open-Api-Token | Yes | JWT token. Please refer to Description of External Interface Signature Authentication Algorithm |
Body
Utilize FORM (multipart/form-data) for submissions. You can refer to the following articles for further understanding:
Like other requests, employ the full body for the signature.
Path Parameters
Parameter | Description |
---|---|
appId | The AppId of the mini program |
Note:
-
There is a total upload count limit for each app. Please contact us if you encounter a limit error.
-
Currently, we only support uploading a single file at a time.
-
This API executes asynchronously. We will conduct a security check on the uploaded file. Use the returned
fileId
with GetFileStatus to verify whether the uploaded file has passed the check. -
The currently acceptable file content is in image format, conforming to the following rules:
- Format: jpg or png
- Size: Maximum 1MB
- File name size: Maximum 60 characters (including extension)
-
We recommend an image size ratio of:
- Width: 516
- Height: 375
For sku images, if an image does not match this ratio, it will be cropped by our system when displayed.
Response
{
"code": "000000",
"message": null,
"data": {
"fileIds": ["f7574adb-0ccb-4281-9ed6-943f11a1e85a"]
},
"success": true
}
ErrorCode | Remark |
---|---|
000000 | Success |
900001 | Invalid Parameter |
900002 | JWT Authentication Failed |
900003 | Unexpected Error |
900231 | Rate Limit |