# Upload Graphic Message Material

Debugging Tools

Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide

Interface English name: uploadnewsmsg

This interface is used for uploading text messages, this capability has been updated to draft box

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=ACCESS_TOKEN

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

  • This interface supports Third Party Platform generation business call.

  • The permission set id to which the interface belongs is: 1,7-9,11,100

  • When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invocation credentials, using access_token , authorizer_access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inIntroductions
articlesobjarrayyesGraphic messages. One Graphic message supports 1 to 8 graphics

# Body.articles(Array)Object Payload

Graphic messages. One Graphic message supports 1 to 8 graphics

Parameter NametypeRequired to fill inIntroductions
titlestringyesGraphic message title
authorstringnoAuthor of the Graphic Message
thumb_media_idstringyesThe media_id of the thumbnail of a text message, available in Material Management - Add Temporary Material
contentstringyesText message page content, support HTML tags.Official Account with WeChat payment authority can use a tag, other Official Account message template can not use.
content_source_urlstringnoOn the page after clicking "Read the original" on the infographic message page, security restrictions apply. To jump to the Appstore, you can use the short-chain service itun.es or appsto.re and add the # wechat_redirect suffix behind the short-link.
digeststringnoDescription of the text message. If this field is empty, it crawls by default the first 64 words of the text
show_cover_picnumbernoShow the cover or not, 1 is shown and 0 is not shown
need_open_commentnumbernoWhether to open comments, 0 does not open, 1 opens
only_fans_can_comment-noWhether fans can comment, 0 everyone can comment, 1 fan can comment

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
typestringTypes of media articles, graphic news (news)
media_idstringThe unique identifier obtained after the image message is uploaded
created_atstringMedia file upload time

# 4. Note

If you need to insert Weixin Mini Program into a group message, you need to add a small pop-up link to the content field when you call the upload message message feed interface, and there are three examples to choose from.

Weixin Mini Program card jump Mini Program, code example:

<mp-common-miniprogram data-miniprogram-appid="wx123123123" data-miniprogram-path="pages/index/index" data-miniprogram-title="小程序示例" data-miniprogram-imageurl="http://example.com/demo.jpg" data-miniprogram-type="card"></mp-common-miniprogram>

Text jump Weixin Mini Program, code example:

<p><a data-miniprogram-appid="wx123123123" data-miniprogram-path="pages/index" href="">点击文字跳转小程序</a></p>

Image jump Weixin Mini Program, code example:

<p><a data-miniprogram-appid="wx123123123" data-miniprogram-path="pages/index" href=""><img src="https://mmbiz.qpic.cn/mmbiz_jpg/demo/0?wx_fmt=jpg" alt="" data-width="null" data-ratio="NaN"></a></p>

# 5. Code examples

Example Requests

{
   "articles": [	 
        {
            "thumb_media_id":"qI6_Ze_6PtV7svjolgs-rN6stStuHIjs9_DidOHaj0Q-mwvBelOXCFZiq2OsIU-p",
            "author":"xxx",		
            "title":"Happy Day",		 
            "content_source_url":"www.qq.com",		
            "content":"content",		 
            "digest":"digest",
            "show_cover_pic":1,
            "need_open_comment":1,
            "only_fans_can_comment":1
        },	 
        {
            "thumb_media_id":"qI6_Ze_6PtV7svjolgs-rN6stStuHIjs9_DidOHaj0Q-mwvBelOXCFZiq2OsIU-p",
            "author":"xxx",		
            "title":"Happy Day",		 
            "content_source_url":"www.qq.com",		
            "content":"content",		 
            "digest":"digest",
            "show_cover_pic":0,
            "need_open_comment":1,
            "only_fans_can_comment":1
        }
   ]
}

Return an example

{
   "type":"news",
   "media_id":"CsEf3ldqkAYJAU6EJeIkStVDSvffUJ54vqbThMgplD-VJXXof6ctX5fI6-aYyUiQ",
   "created_at":1391857799
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
0Ok or in a normal stateOK means to go from abnormal to normal in a normal state

# 7. Scope of application

How this interface can be invoked under different account types:
Official Account Service Account
Certification only Certification only
  • Authentication only: means that only authenticated accounts are allowed to be invoked by the enterprise entity, and accounts that are not authenticated or do not support authentication cannot be invoked.
  • Other account types that are not expressly stated may not be called on this interface without special instructions;