Public platform development Customer Service Interface to send customer service messages
Author: Fang Times studio
Address: http://www.cnblogs.com/txw1958/p/weixin73-custom-send.html
When a user actively sends a message to the public account (including sending information, clicking a custom menu clike event, subscribing to an event, scanning a QR code event, successful payment event, and rights protection ), message data will be pushed to developers. developers can call the customer service message interface within a period of time (currently 24 hours) and send messages to common users by posting a JSON data packet, the number of sending times is not limited within 24 hours. This interface is mainly used for customer service and other features with manual message processing links, so that developers can provide users with better services.
1. Get ACCESS_TOKEN
Http Request Method: GET
Https://api.weixin.qq.com/cgi-bin/token? Grant_type = client_credential & appid = APPID & secret = APPSECRET
Parameters |
Required? |
Description |
Grant_type |
Yes |
Obtain access_token and enter client_credential |
Appid |
Yes |
Unique third-party user credential |
Secret |
Yes |
The unique credential key of a third-party user, which is appsecret |
Normally, the following JSON data packet is returned to the Public Account:
{& Quot; access_token & quot;: & quot; ACCESS_TOKEN & quot;, & quot; expires_in & quot;: 7200}
Ii. Send messages
Send text messages
= '' = "NU7Kr6v9L9TQaqm5NE3OTPctTZx797Wxw4Snd2WL2HHBqLCiXlDVOw2l-Se0I-WmOLLniAYLAwzhbYhXNjbLc_KAA092cxkmpj5FpuqNO0IL7bB0Exz5s5qC9Umypy-rz2y441W9qgfnmNtIZWSjSQ" = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=". = https_post(,( https_post(, =, CURLOPT_URL, , CURLOPT_SSL_VERIFYPEER, , CURLOPT_SSL_VERIFYHOST, , CURLOPT_POST, 1, CURLOPT_POSTFIELDS, , CURLOPT_RETURNTRANSFER, 1 = curl_exec( (curl_errno( 'Errno'.curl_error(
Send an image (media_id needs to be uploaded first)
= '';
========================================================== ====
Follow-up methods for fanwe public platform accounts:
1. Address Book-Add friends-search for Public Accounts-search for "fangtimes Studio"
2. Address Book-add friend-search number-Enter "pondbaystudio"
3. Scan the following QR code