Nickel Titanium Alloy News and > Nickel Titanium Alloy News > Advanced group sending interface of wechat public platform

Advanced group sending interface of wechat public platform

Nickel Titanium Alloy News 2021-08-09 09:42 175
Developer document from wechat public platform

on the public platform website, the subscription number is provided with one group sending permission every day, and the service number is provided with four group sending permissions every month (NATURAL month). For some official account operators who have the ability to develop, they can achieve more flexible group capacity through the advanced group interface. 1}

please note:

 1. The interface is only provided to the service number authenticated by wechat for the time being
2. The daily call of the advanced group sending interface is limited to 10 times. Please test carefully
3. No matter on the public platform website or using the interface for mass sending, users can only receive 4 mass messages per month, and more than 4 mass messages will fail to send to the user.
catalogue [hide] 1 upload graphic message material 2 group sending according to groups 3 mass sending according to openid list 4. Delete mass sending 5 event push group sending result Upload graphic message material

interface call request description

 HTTP request method: Post
https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_ token=ACCESS_ TOKEN

post data description

An example of

post data is as follows:

{
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
},
{
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
}
]
}
Must the parameter be specified Articles yes A graphic message supports 1 to 10 graphic messages thumb_ media_ id yes Media for text message thumbnail_ id author no Author of graphic message title yes Title of graphic message content_ source_ url no Click the page after \ content yes The content of graphic message page supports HTML tags digest no Description of graphic message

return description

return data example (JSON return result when correct):

{
type:news,
media_ id:CsEf3ldqkAYJAU6EJeIkStVDSvffUJ54vqbThMgplD-VJXXof6ctX5fI6-aYyUiQ,
created_ at:1391857799
}
Parameter description type Media file types include image, voice, video and thumbnail, and the number of times is news, that is, graphic messages media_ id Unique identification obtained after uploading media files / graphic messages created_ at Media file upload time When

is wrong, wechat will return error code and other information. Please query the error information according to the error code: description of global return code

Group sending according to groups

interface call request description

 HTTP request method: Post
https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_ token=ACCESS_ TOKEN

post data description

An example of

post data is as follows:

graphic message (pay attention to the media of graphic message)_ ID needs to be obtained by the above method):

{
filter:{
group_ id:2
},
mpnews:{
media_ id:123dsdajkasd231jhksad
},
msgtype:mpnews
}
Must the parameter be specified filter yes Used to set the receiver of text message group_ id yes Group of group sent to_ id mpnews yes Used to set the text message to be sent media_ id yes Media for mass messages_ id msgtype yes The message type of mass sending. The graphic message is mpnew

return description

return data example (JSON return result when correct):

{
errcode:0,
errmsg:send job submission success,
msg_ id:34182
}
Parameter description type Media file types include image, voice, video and thumbnail, and the number of times is news, that is, graphic messages errcode Error code errmsg error message msg_ id Message ID

please note: when success is returned, it means that the group sending task has been submitted successfully, but it does not mean that the group sending has ended. Therefore, there may still be exceptions in the subsequent sending process, resulting in the user not receiving the message, such as the message is sometimes audited, the server is unstable, etc. In addition, mass sending tasks generally take a long time to complete. Please wait patiently

When

is wrong, wechat will return error code and other information. Please query the error information according to the error code: description of global return code

Mass sending according to openid list

interface call request description

 HTTP request method: Post
https://api.weixin.qq.com/cgi-bin/message/mass/send?access_ token=ACCESS_ TOKEN

post data description

An example of

post data is as follows:

text message:

{
touser:[
OPENID1,
OPENID2
],
mpnews:{
media_ id:123dsdajkasd231jhksad
},
msgtype:mpnews
}

parameter Is it necessary explain touser yes Fill in the recipients of graphic messages and a list of openids. There are at least 10000 openids and at most 10000 openids mpnews yes Used to set the text message to be sent media_ id yes Media for mass graphic messages_ id msgtype yes The message type of mass sending. The graphic message is mpnew

return description

return data example (JSON return result when correct):

{
errcode:0,
errmsg:send job submission success,
msg_ id:34182
}
Parameter description type Media file types include image, voice, video and thumbnail, and the number of times is news, that is, graphic messages errcode Error code errmsg error message msg_ id Message ID

please note: when success is returned, it means that the group sending task has been submitted successfully, but it does not mean that the group sending has ended. Therefore, there may still be exceptions in the subsequent sending process, resulting in the user not receiving the message, such as the message is sometimes audited, the server is unstable, etc. In addition, mass sending tasks generally take a long time to complete. Please wait patiently

When

is wrong, wechat will return error code and other information. Please query the error information according to the error code: description of global return code

Delete mass sending

interface call request description

 HTTP request method: Post
https://api.weixin.qq.com//cgi-bin/message/mass/delete?access_ token=ACCESS_ TOKEN

post data description

An example of

post data is as follows:

{
msgid:30124
}
Must the parameter be specified msg_ id yes Sent message ID

please note that only messages that have been successfully sent can be deleted. Deleting a message only invalidates the graphic details page of the message. Users who have received the message can still see the message card locally

return description

return data example (JSON return result when correct):

{
errcode:0,
errmsg:ok
}
Parameter description errcode Error code errmsg error message When

is wrong, wechat will return error code and other information. Please query the error information according to the error code: description of global return code

Event push group sending result

since the group sending task may not be completed until a certain time after the group sending task is submitted, when the group sending interface is called, it will only give a prompt whether the group sending task is submitted successfully. If the group sending task is submitted successfully, an event will be pushed to the developer URL (callback URL) filled in by the developer on the public platform at the end of the group sending task

The XML structure pushed by

is as follows (when sending is successful):

< xml>
< ToUserName>% 26lt;![ CDATA[gh_ 3e8adccde292]]>% 26lt;/ ToUserName>
< FromUserName>% 26lt;![ CDATA[oR5Gjjl_ eiZoUpGozMo7dbBJ362A]]>% 26lt;/ FromUserName>
< CreateTime> 1394524295</ CreateTime>
< MsgType>% 26lt;![ CDATA[event]]>% 26lt;/ MsgType>
< Event>% 26lt;![ CDATA[MASSSENDJOBFINISH]]>% 26lt;/ Event>
< MsgID> 1988</ MsgID>
< Status>% 26lt;![ CDATA[sendsuccess]]>% 26lt;/ Status>
< TotalCount> 100</ TotalCount>
< FilterCount> 80</ FilterCount>
< SentCount> 75</ SentCount>
< ErrorCount> 5</ ErrorCount>
</ xml>
Parameter description ToUserName Micro signal of official account FromUserName The official account is a mphelper. CreateTime Timestamp of creation time MsgType Message type, event here Event Event information, masssendjobinfo here MsgID Mass message ID Status The structure of mass sending is \

err (10001), / / suspected of advertising err (20001), / / suspected of political err (20004), / / suspected of social err (20002), / / suspected of pornography err (20006), / / suspected of illegal crime err (20008), / / suspected of fraud err (20013), / / suspected of copyright err (22000), / / suspected of mutual promotion err (21000), / / suspected of other

TotalCount group_ Number of fans under ID; Or openid_ Number of fans in the list FilterCount Filtering (filtering means the number of fans ready to send after some users set up messages that WeChat does not receive the official account), in principle, FilterCount = SentCount + ErrorCount SentCount Number of fans sent successfully ErrorCount Number of fans failed to send Taken from“ http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口 ”      

group sending interface and analysis of four times: first, the group sending rule of four times a month applies to all service numbers. The general service number can send messages in groups through the MP background (i.e. the background of the public platform). For the authentication service number, in addition to the MP background, it can also send personalized messages in groups through the new group sending interface. This is the most important for third-party product design. The following in-depth interpretation is mainly aimed at this aspect. Second, the new group sending interface implements the rule of \

Tag:Advanced,group,sending,interfa