Add permanent material
Add permanent material
In addition to temporary materials that will expire in 3 days, developers sometimes need to save some materials permanently. At that time, they can add permanent materials through this interface. material.
Recently updated, after the permanent picture material is added, the URL will be returned to the developer. The developer can use it within the Tencent domain name (if used outside the Tencent domain name, the picture will be blocked).
Please note:
1. The newly added permanent materials can also be seen in the material management module of the official website of the public platform
2. The number of permanent materials is If there is an upper limit, please add it with caution. The upper limit of graphic message materials and picture materials is 5000, and the upper limit of other types is 1000
3. The format and size of the materials are consistent with the official website of the public platform. Specifically, the image size does not exceed 2M, supports bmp/png/jpeg/jpg/gif format, the voice size does not exceed 5M, the length does not exceed 60 seconds, and supports mp3/wma/wav/amr format
4, Calling this interface requires https protocol
Add permanent graphics and text materials
Interface call request instructions
Call example
Parameter Description
Parameter | Is it necessary | Description |
title | is | title |
thumb_media_id | is the cover picture material id of the | graphic message (must be a permanent mediaID) |
author | 是 | author |
digest | 是 | Summary of graphic and text messages. Only single graphic and text messages have abstracts. Multiple graphic and text messages are left empty. |
##show_cover_pic | is | whether to display the cover, 0 is false, that is, it is not displayed, 1 is true, that is, it is displayed |
##content | is the specific content of thegraphic message. It supports HTML tags and must be less than 20,000 characters and less than 1M, and JS# will be removed here. | |
is the original address of the | graphic message, that is, click "Read the original text" The following URL |
Parameter | Is it necessary | Description |
access_token | is | Call interface credentials |
media | is the media file identifier in | ##form-data, including filename, filelength, content-type and other information |
Parameter | Is it required | Description |
access_token | is | 调用接口凭证 |
type | 是 | 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb) |
media | is the media file identifier in | ##form-data, including filename, filelength, content-type and other information |
Parameter | Is it necessary | Description |
title | is the title of the | video material |
introduction | is the description of the | video material |
Return description
"media_id":MEDIA_ID,
"url":URL
}
Return parameter description
Parameters | Description |
media_id | The media_id of the new permanent material |
url | The image URL of the newly added image material (this field will be returned only when adding image material) |
An example of the returned JSON data packet in error conditions is as follows (the example is an invalid media type error):