Skip to main content

UploadFile

Host: dip-cb.binanceapi.com

POST /mp-api/v1/apps/{appId}/files/upload

Header

ParameterRequiredDescription
X-Mp-Open-Api-TokenYJWT 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

ParameterDescription
appIdappId of the mini program

Note:

  1. There is a total upload count limit for one app. Please contact us if you meet the limit error.
  2. We only accept uploading one file at a time now.
  3. 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.
  4. Current acceptable file content is image and please follow the following rules:
    1. format: jpg or png
    2. size: 1MB max
    3. File name size: max 60 (includes extension)
  5. Recommendatrion image size ratio is
    1. width: 516
    2. height: 375

For sku image. If your image is not this ratio, your image will be cut by us when displayed.

Response

{  "code": "000000",  "message": null,  "data": {     "fileIds": ["f7574adb-0ccb-4281-9ed6-943f11a1e85a"]  },  "success": true}
ErrorCodeRemark
000000Success
900001Invalid param
900002Jwt auth failed
900003Unexpected error
900231Rate limit