Public Account Development Series-send customer service messages, public customer service
The following are the two most common types of customer service messages used for public account development: Text and text.1. send text messages
{ "touser":"OPENID", "msgtype":"text", "text": { "content":"Hello World" }}
Parameters |
Required? |
Description |
Access_token |
Yes |
Interface call credential |
Touser |
Yes |
Openid |
Msgtype |
Yes |
Message Type, text |
Content |
Yes |
Text message content
|
2. Send text message
The number of text and text messages is limited to 10. Note that if the number of text messages exceeds 10, no response is returned.
{ "touser":"OPENID", "msgtype":"news", "news":{ "articles": [ { "title":"Happy Day", "description":"Is Really A Happy Day", "url":"URL", "picurl":"PIC_URL" }, { "title":"Happy Day", "description":"Is Really A Happy Day", "url":"URL", "picurl":"PIC_URL" } ] }}
Parameters |
Required? |
Description |
Access_token |
Yes |
Interface call credential |
Touser |
Yes |
Openid |
Msgtype |
Yes |
Message Type, news |
Title |
No |
Title |
Description |
No |
Description |
Url |
No |
Click the link to jump |
Picurl |
No |
Image links of text and text messages. JPG and PNG formats are supported. The larger image size is 640*320, and the smaller image size is 80*80. |
Use the Web debugging tool to debug this interface
3. Sending text message code example
When sending a text message, the text information is not listed because the parameters are inconsistent.
Protected void btnSen_Click (object sender, EventArgs e) {var accessToken = SettingHelper. getSettingByAccessToken (); if (string. isNullOrWhiteSpace (accessToken) accessToken = SettingHelper. getAccessToken (); if (string. isNullOrWhiteSpace (accessToken) {Response. write (accessToken); return;} var data = "{\" touser \ ": \" OPENID \ "},"; data + = "{\" msgtype \": \ "text \"}, "; data + =" {\ "text \": [{\ "content \" : \ "This is a text Test message! \ "}]}"; Var json = HttpHelper. Post ("https://api.weixin.qq.com/cgi-bin/message/custom/send? Access_token = "+ accessToken, data); Response. Write (json); Response. End ();}
If the user does not interact with the customer service Message of the service number within 48 hours, the message cannot be sent, and the enterprise number message is pushed without restrictions. For other message sending types, click to go to the development platform development documentation.
Does the public account development interface send information to the specified account?
In order to avoid harassment, the public platform has made special settings. Only when the other party actively interacts with you for 48 hours can you actively push information with the other party.
Or you can group the people first and then send them group information in a group.
Other methods may be blocked. We strongly recommend that you do not use them!
How to send webpage information with a public account
This is developed by a third party. First, you need to set your public account to the development mode, and then find a third-party interface for access. You can set it in their background. In fact, it is to set a text message, this message carries a jump link. After receiving the text message, the user side directly triggers the set jump link.