UploadFile
Host: dip-cb.binanceapi.com
POST /mp-api/v1/apps/{appId}/files/upload
Header
Parameter | Required | Description |
---|---|---|
X-Mp-Open-Api-Token | Y | JWT token, please refer to Description of External Interface Signature Authentication Algorithm |
Body
Use FORM (multipart/form-data). You can take references in the following articles.
https://www.sobyte.net/post/2021-12/learn-about-http-multipart-form-data
https://everything.curl.dev/http/multipart
Use the whole body to do signature like other requests.
Path Parameters
Parameter | Description |
---|---|
appId | appId of the mini program |
Note:
- There is a total upload count limit for one app. Please contact us if you meet the limit error.
- We only accept uploading one file at a time now.
- This API is asynchronous. We will perform a security check to the uploaded file. You can use returned
fileId
with GetFileStatus to check if the uploaded file passes the check or not. - Current acceptable file content is image and please follow the following rules:
- format: jpg or png
- size: 1MB max
- File name size: max 60 (includes extension)
- Recommendatrion image size ratio is
- width: 516
- height: 375
For sku image. If your image is not this ratio, your image will be cut by us when displayed.
Response
ErrorCode | Remark |
---|---|
000000 | Success |
900001 | Invalid param |
900002 | Jwt auth failed |
900003 | Unexpected error |
900231 | Rate limit |