Micro-Credit Public account development tutorial (14) Customizing menu creation and Menu event response

Source: Internet
Author: User
Tags http request json

Micro-Letter 5.0 Release

August 5, 2013, with the release of the micro-letter 5.0 iphone version, the public platform has also made important updates, mainly including:

1 The operation of the main body for the organization, you can choose to become a service number or subscription number;

2 The service number may request the custom menu;

3 The use of QQ login public number, you can upgrade to the mailbox login;

4 Use the public number of the mailbox login, you can modify the login mailbox;

5 Edit the text message can be selected to fill the author;

6 mass message can be synchronized to Tencent Weibo.

Among them, we talk about the most when the first two, is about the account type and custom menu updates, I do a few additional notes here:

1 The current type of public number is divided into two types: service number and subscription number, August 5, the platform after the update of all accounts default for the subscription number, the opportunity to convert to a service number;

2 service number is mainly for enterprises, Governments and other organizations, while the subscription number is mainly for the media and individuals;

3 Only the service number can request the custom menu, the subscription number cannot apply;

4 Service number can only send a message per month, and the subscription number can be a mass message.

After the platform update, let a lot of people tangle is the custom menu and the daily mass of a message can not be both, for this, I do not want to comment too much.

Introduction and summary of content

Before the micro-letter 5.0, the custom menu is used as a beta qualification, only a small number of public accounts have menus, so there are many companies in order to get the menu at the expense of buying. Today, a large number of accounts from the subscription number to the service number, many are running the custom menu to go. Moreover, the test found that the micro-letter of the recent audit to relax a lot, as long as the application service number, custom menu of the basic success, no matter whether the information is true or FALSE. Do not know after the micro-letter will not turn, the requirements of the enterprise information, it will be a kind of candy to the child to eat and then make him cry feeling ...

Custom menu is the application, how to create, how to use it? In recent days, whether it is the micro-credit official Exchange group, or in my blog message, can see a lot of developers are worried about this. This article will solve this problem for everyone.

Customizing the menu Creation step

1, find AppID and Appsecret. The last two of the "Advanced Features"-"Development Mode"-"Interface configuration Information", after the success of the custom menu request;

2, according to AppID and Appsecret, in HTTPS get way to obtain access to a special interface voucher Access_token;

3, according to Access_token, the JSON format of the menu data through the HTTPS post method submitted.

Analyze the difficulty of creating a menu

Originally create the menu so simple, three steps can be done? It's almost like putting an elephant in the fridge. Oh, of course not so simple, then we step by step, in the end is difficult where?

First of all, the 1th step is certainly no problem, as long as the successful application of the custom menu, will be able to get AppID and appsecret these two values.

Look at the 2nd step, because it is getting way to get access_token, many people directly put the spelling of the URL in the browser to execute, Access_token got it. It is a good idea to put aside the realization of programming, and obviously there is no problem in the second step.

Finally look at the 3rd step, assembled in the JSON Format menu data, although the lock a little, but basically there is no problem, because the official gave an example, suit on the line. The problem must have appeared on the HTTPS post submission.

Conclusion: Friends who do not know how to create custom menus can be grouped into the following three situations:

1 don't read or read the description of the general interface, custom menu interface, and Use Restrictions section in the Public Platform API documentation;

2 do not know how to initiate HTTPS request (the usual HTTP request, the direct use of httpurlconnection can be easily done, but the HTTPS request is a bit more complicated);

3 does not know how to submit a JSON-formatted menu data by post.

Reading the article you, do not know what kind of, or several situations have, may wish to leave a message to say, you can do a survey. In either case, since you've seen this article, I'm sure you'll figure it out.

Understanding the acquisition of document---documents for common interface

Let's take a look at the introductory section of the generic interface document, as shown in the following illustration.

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.