POST https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=ACCESS_TOKEN&type=TYPE
參數說明:
參數 是否必須 說明
access_token 是 調用接口憑證
type 是 媒體文件類型,分別有圖片(image)、語音(voice)、視頻(video)和縮略圖(thumb)
media 是 form-data中媒體文件標識,有filename、filelength、content-type等信息
以新增圖片素材為例,如下圖:
提交后,返回結果如下圖
成功!
注意:視頻素材需額外提交POST另一個表單,參考官網API
官方API:https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Adding_Permanent_Assets.html