Shake WeChat to upload picture materials
Upload picture material
##Interface Description
Upload in Shake The picture materials needed for the one-shake function are stored on the WeChat server. Image formats are limited to: jpg, jpeg, png, gif.
If the picture is displayed on the shake page, the material is an icon type picture. The picture size is recommended to be 120px*120 px, and the limit should not exceed 200 px*200 px. The image needs to be square.
If the picture is a qualification file picture that needs to be uploaded to apply for the shake peripheral function, the material must be a license type picture. The file size of the picture shall not exceed 2MB, and the size is not limited. No limit on shape.
Interface calling instructions
http request method: POST (please use https protocol) https://api.weixin.qq.com/shakearound/material/add?access_token=ACCESS_TOKEN&type=TYPEPOST data format: FORM form
POST data example:
Call example (use curl command to upload a multimedia file using FORM form):
curl -F "media=@IMAGE_NAME"
"https://api.weixin.qq .com/shakearound/material/add?access_token=ACCESS_TOKEN&type=TYPE"
Parameter Description
Parameter | Is it required | Description |
access_token | is the | calling interface credential |
media | is | Picture name |
type | No | Icon: the icon picture displayed on the shake page; License: the qualification document that needs to be uploaded when applying for the shake peripheral function; if the type is not passed, the default type=icon |
Return instructions Normal return JSON data packet example:
{
"data": {
"pic_url":
"http://shp.qpic.cn/wechat_shakearound_pic/0/1428377032e9dd2797018cad79186e03e8c5aec8dc/120"
},
"errcode": 0,
"errmsg": "success."
}
Parameter Description
参数 | 说明 |
pic_url | 图片url地址,若type=icon,可用在“新增页面”和“编辑页面”的“icon_url”字段;若type= license,可用在“申请入驻”的“qualification_cert_urls”字段 |