Micro-Credit Public account development tutorial (iv) Encapsulation of message and message processing tools

Source: Internet
Author: User

工欲善其事 its prerequisite! This article focuses on how to encapsulate the message and message-related operations defined by the micro-trust public platform into a tool class and later use. It needs to be clear that the message is actually sent to you by the user, the message is received by the micro-trust platform, and then the micro-trust platform will transfer the message to you in the development mode interface configuration specified in the URL address.

Message interface for micro-trust public platform

To receive messages sent by the micro-trust platform, we need to familiarize ourselves with the message Interface section of the micro-trust public platform API, click here, and then enter the Message Interface Guide section, as shown in the following illustration:

On the left-hand side of the image above, you can see that there are three kinds of interfaces open to the micro-trust public platform: Message interface, Universal interface and custom menu interface. Common interface and custom menu interface can only be invoked if you get a beta qualification. And the application of the inside qualification has been closed, we only look forward to a certain day the micro-letter will be open to the public, so there is no qualifying users do not waste time on these two interfaces, just need to use the good message interface can be.

Message push and message reply

The message interface is mainly described below. For the reception and response of the message we only need to focus on the "4 message Push" and "5 message reply" In the above figure is enough.

Let's first understand what "message push" means in the interface, click "4 Message Push", you can see the interface of "message push" refers to "when ordinary users to the public account message, the micro-trust server will post the message to fill the URL," that is defined here is the user can send what types of messages, What are the fields of the message and how the message is forwarded to our public account backstage by the micro-trust server.

Message push defines 5 types of messages that we will receive: text messages, picture messages, geographic location messages, link messages, and event tweets, in fact, we can also receive the voice message, but not to get the specific voice files and to (need to be able to obtain a voice file in the beta).

The "message reply" in the interface defines the message type, message field, and message format that we can reply to the user, as described in the interface Guide for the microblogging public platform:

There are 5 messages that we can reply to the user, but there are only 3 messages that can be answered in development mode: text messages, music messages, and messages, while voice and video messages are currently available only in edit mode.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.