The WeChat public platform is a platform for operators to provide information and services to WeChat users through public accounts. The public platform development interface is the basis for providing services. After developers create a public account on the public platform website and obtain interface permissions, they can read through This interface document helps development.
In order to identify users, each user will generate a secure OpenID for each public account. If you need to share users between multiple public accounts and mobile applications, you need to go to the WeChat open platform and bind these public accounts and applications to Under an open platform account, after binding, although a user has multiple OpenIDs for multiple public accounts and applications, he has only one Unio nID for all public accounts and applications under the same open platform account. User Management-Get user basic information (Unio nID mechanism) document for details.
1. WeChat public platform development refers to the development of WeChat public account business development, the development of mobile applications, PC-side websites, public account third-party platforms (providing services for public account operators in various industries), please visit the WeChat open platform Into.
2. Before applying for the certification public number, you can quickly apply for an interface test number through the test number application system, and immediately begin interface test development. 3. During the development process, you can use interface debugging tools to debug some interfaces online.
4. Each interface has a daily interface call frequency limit. You can check the specific frequency on the official platform official website-Developer Center. 5. When there is a problem in development, you can find and solve the problem through the return code called by the interface and the alarm troubleshooting guidelines (the interface alarm can be set at the official platform official website-Developer Center).
6. The public platform uses access_token as the interface to call credentials to call the interface. All interface calls need to obtain access_token first. Access_token is valid within 2 hours and expires and needs to be obtained again. See the documentation for obtaining the interface call credentials (access_token).
7. Public platform interface calls only support port 80.
The public account mainly provides services for users through the public account message session and the web page within the public account. The two cases are described below:
1.Public account message session
The public account exists as a contact of the WeChat user, and the message session is the basis for the interaction between the public account and the user. At present, there are mainly several types of message services in public accounts, which are respectively used in different scenarios.
1) Group messaging: The public account can send messages to users in a certain frequency (subscription number is once a day and service number is four times a month), including text messages, graphic messages, pictures, videos, voice, etc.
2) Passive reply message: After the user sends a message to the public account, the WeChat server will send the message to the server address set by the developer in the developer center in advance (the developer needs to verify the authenticity of the message). The public account can be sent in 5 seconds. You can reply within a reply, you can reply to a message, or you can reply a command to tell the WeChat server that this message will not be answered for the time being. Passive reply messages can be encrypted (set in the developer center of the public platform official website. After setting, the messages are processed according to the message encryption and decryption documents. The other three types of message calls are API calls instead of returning the request, so there is no need to Encryption and decryption).
3) Customer service message: Within 48 hours after the user sends a message to the public account, the public account can send an unlimited number of messages to the user, which is mainly used in customer service scenarios. User actions will trigger event pushes, and some event pushes support public accounts to send customer service messages accordingly. For details, see WeChat push messages and event documentation.
4) Template message: When it is necessary to send a service notification to the user (such as a credit card reminder, a service reservation success notification, etc.), the public account can use a specific content template to actively send a message to the user.
2.Web pages in the public account
Many complex business scenarios need to provide services through the form of web pages. At this time, you need to use:
1) Authorization of web pages to obtain basic information of users: Through this interface, basic information of users can be obtained (the user's OpenID is not required for the user's consent, and the user's basic information requires the user's consent)
2) WeChat JS-SDK: It is a toolkit for developers to use WeChat native functions through Javas cript code on web pages. Developers can use it to record and play WeChat voice on web pages, monitor WeChat sharing, upload local pictures on mobile phones, take photos, etc. Many capabilities.