Public Account development course, Public Course
1. Category of public accounts and registered 1.1 Public Accounts
There are currently three types of public accounts: subscription number, service number, and enterprise number. In addition, there is also a kind of mini-program launched later that has a relationship with the public number.
The functions of the subscription number, service number, and enterprise number are as follows:
In our daily use, we can see that the subscription number will be placed in the "subscription number" and will not appear in the chat bar directly, instead, it is placed in the second-level directory (such as Tiger sniffing network and 36 helium ). The service number is directly placed in the top-level directory of the chat Panel (such as China Mobile 10086). It is mainly used by some large companies to provide services, and the subscription number is mainly used for consulting and media. The enterprise number is mainly used for internal communication within the company. It is not described here.
1.2 public account registration
The public account is independent and needs to be registered and bound separately. Therefore, if you log on to the public account platform directly with your account instead of registration, you cannot log on to the public account platform.
The registration of public accounts should be based on the development needs to select different types of public accounts. The registration process is simple, and the basic information, email activation, and Information registration processes should be completed officially, you have a public account.
The login public platform provides two modes: development and non-development. In non-development mode, some basic such as message sending and menu definition are provided. In development mode, in addition to non-development basic functions, you can also create more interesting functions based on the provided interfaces. Note that you can only select one of the two modes. If you select the development mode, the non-development mode is disabled. That is to say, if you choose the development mode, you cannot use the convenient custom menu function provided by the background management system if you want to define the menu, instead, you must use the provided custom menu interface to call the interface.
2. Basic Process of platform message transmission
First, let's talk about the basic messaging process on the platform. More concepts and interface usage will be easier to understand.
When using some public numbers, we must have encountered this situation. When sending messages to the public numbers, it will reply to your different content, that is, this public number can identify your message type and content, and then make different feedback. Even complex, you can simulate an automatic response robot. (For example, China Mobile)
Then we will understand how the message was processed in the past.
Image and partial description:
When a user sends a message to the public account, it does not directly arrive at our server, but first arrives at the server. The server assembles the user's message into xml files in some specific formats, this xml file includes the receiver, message type, and sending time, and then handed over to our server. Our server parses the messages in this format and makes judgments as needed. Then, it assembles the messages we want to return into a compliant xml file and sends them to the server, it then performs resolution and return processing.
(The GET method requests access to our server are mainly used for server verification, while the POST method is mostly used for interaction, that is, when users send messages, we set the logic to respond, therefore, after a request arrives at our server, it must be determined based on different request types before logical processing)
So here, we now have a public number. In addition to code, we also need the server that carries the code, because it is online, which requires our server to be online, unlike our usual web project testing, we can run it on our own computer. Therefore, many tutorials will also start by telling readers to prepare servers online for Environment Development.