# Upload Pictures

# Dxplaination of Interface Call Request

When uploading categories, brands and goods, you need to use the image upload interface for temporary links for uploading, and after uploading, WeChat side will be converted to permanent links.Temporary links are permanently valid on the WeChat side, and the merchant side can store temporary links to avoid repeated exchange of links.

WeChat Side component image domain name, store.mp. video .tencent-cloud.com , mmbizurl.cn , mmecimage.cn/p/

https://api.weixin.qq.com/shop/img/upload?access_token=xxxxxxxxx

# Example Requests

curl -F media=@test.jpg "https://api.weixin.qq.com/shop/img/upload?access_token=xxxxxxxxx" -F resp_type=0

# Dxplaination of request parameters

Content-Type: multipart / form-data, image size limit 2 MB

parameter type Is it compulsory? Introductions
resp_type number yes Responsive format, 0: media_id (currently only for brand applications brands and categories), 1: return link, 2: return WeChat Pay media_id Picture requirements
upload_type number yes 0: image stream (resp_type = 2 filename required), 1: image url
img_url string no Upload_type = 1

Note: Temporary links are converted to permanent links on the WeChat side

# Examples of back-up

{
    "errcode": 0,
    "errmsg":"ok",
    "img_info":
    {
        "temp_img_url": "http://URL地址",
        "media_id": "wxashop_xxxx",
        "pay_media_id": "pay_media_id"
    }
}

# Dxplaination of callback parameters

parameter type Introductions
errcode number Error code
errmsg string Error message
img_info.media_id string Open Platform media_id
img_info.temp_img_url string Images are linked, have access restrictions, cannot be used as a drawing board, the consequences are your own.
img_info.pay_media_id string WeChat payment media_id