# Upload pictures

# Interface call request specification

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

WeChat side component picture domain name,store.mp.video.tencent-cloud.com or mmbizurl.cn

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

# Sample request

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

# Request Parameter Dxplaination

Content-Type: multipart/form-data, Image Size Limit 2 MB

parameter type Required Required Introductions
or_type number yes 0: This parameter returns media_Id, currently only used for brand application brand and category, recommended to use 1: return the temporary link
upload_type number yes 0: image stream, 1: image url
img_url string no upload_Type = 1

Note: Temporary links will turn to permanent links on the WeChat side

# Return Package Example

    "errcode": 0,
        "temp_img_url": " http://wwww.xxx.com",
        "media_id": "wxashop_xxxx"

# Return parameter specification

parameter type Introductions
Errcode number Error code
errmsg string Error message
img_info.media_id string media_id
img_info.temp_img_url string Temporary link