Developers can get added permanent asset list by type.
Notes:
- Articles, voices, and videos created by the Official Account in the Media Asset Management module on the Official Accounts Platform are also included in the permanent asset list.
- Temporary assets cannot be obtained via this API.
- This API must be called using the HTTPS protocol.
API Request Format
HTTP request method: POST
https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=ACCESS_TOKEN
Calling Example
{
"type":TYPE,
"offset":OFFSET,
"count":COUNT
}
Parameters
Parameter | Required | Description |
---|---|---|
type | Yes | Asset type: images (parameter = "image"), videos (parameter = "video"), audio (parameter = "voice"), and articles (parameter = "news"). |
offset | Yes | Return from the offset of all assets. 0 represents return from the first asset. |
count | Yes | Number of returned assets. Value range: 1-20. |
Response Description
Response to the list of permanent articles is as follows:
{
"total_count": TOTAL_COUNT,
"item_count": ITEM_COUNT,
"item": [{
"media_id": MEDIA_ID,
"content": {
"news_item": [{
"title": TITLE,
"thumb_media_id": THUMB_MEDIA_ID,
"show_cover_pic": SHOW_COVER_PIC(0 / 1),
"author": AUTHOR,
"digest": DIGEST,
"content": CONTENT,
"url": URL,
"content_source_url": CONTETN_SOURCE_URL
},
//A multiple-article broadcast will include information for multiple articles here
]
},
"update_time": UPDATE_TIME
},
//There may be multiple article item structures
]
}
Response for other types (image, voice, and video) is as follows:
{
"total_count": TOTAL_COUNT,
"item_count": ITEM_COUNT,
"item": [{
"media_id": MEDIA_ID,
"name": NAME,
"update_time": UPDATE_TIME,
"url":URL
},
//There may be multiple assets
]
}
Response Parameters
Parameter | Description |
---|---|
total_count | The total number of assets of this type |
item_count | The number of assets obtained in this call |
title | The article's title |
thumb_media_id | The ID for the cover image asset of articles (it must be a permanent mediaID) |
show_cover_pic | Indicates whether to display the cover. 0 is false, indicating not to display; 1 is true, indicating to display. |
author | The author |
digest | The summary of an article. Only the single article has a summary. For multiple articles, it is empty. |
content | Detailed contents of articles, which supports HTML tags. It must be less than 20,000 characters and 1 MB in size. JS-related content will be removed. |
url | The URL of an article page. For an image list, this field is the URL of the image. |
content_source_url | The URL to the original page of an article. This is the URL to be redirected to after Read More is tapped. |
update_time | The time when the article was last updated |
name | File name |
The returned JSON packet for a failed request (this is an example of invalid media type):
{"errcode":40007,"errmsg":"invalid media_id"}