Get temporary assets
Get temporary materials
## Public accounts can use this interface to obtain temporary materials (i.e. download temporary multimedia files). Please note that video files do not support https downloading, and http protocol is required to call this interface.
This interface is the original "Download Multimedia Files" interface.
Interface call request description
http request method: GET, https call
https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
Request example ( The example is to obtain multimedia files through the curl command)
curl -I -G "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id =MEDIA_ID"
Parameter Description
Parameter | Is it required | Description |
access_token | is the | calling interface credential |
media_id | is | media file ID |
Return instructions
The returned HTTP header in the correct case is as follows:
HTTP/1.1 200 OK
Connection: close
Content-Type: image/ jpeg
##Content-disposition: attachment; filename="MEDIA_ID.jpg"
##Date: Sun, 06 Jan 2013 10:20:18 GMTCache-Control: no-cache, must-revalidate
Content-Length: 339721
curl -G "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID"
The example of the returned JSON data packet in the error case is as follows (the example is the invalid media ID error):
{"errcode":40007,"errmsg" :"invalid media_id"}