WeChat Developer Migration Guide

If you have developed the WeChat public platform before using the Weibo fan service platform, it is strongly recommended to read this document to understand the details of the migration process;


The migration of WeChat developers was considered at the beginning of the design of Weibo fan service interface, so the migration cost is not high; However, developers still need to adapt to the following three differences:

Difference 1: When applying for the message interface, WeChat fills in Token and Weibo fills in Appkey

stay Application message interface In Weibo, developers need to fill in the URL and Appkey, while WeChat requires developers to fill in the URL and Token;


WeChat Token is a character filled in by developers at will, and is only used to "verify the validity of URL";

The Weibo Appkey is provided by the Weibo official. In addition to "verifying the validity of the URL", it is also used to represent the identity of the developer;


In the "Verify URL Validity" phase, the AppSecret corresponding to the developer's Appkey is used to generate signature; In other words, the encryption process of Weibo's signature field is basically the same as that of WeChat. The only difference is that the Token field used for WeChat encryption is replaced by the AppSecret field on Weibo;

Difference 2: The access _token is generated in different ways and has different validity periods

The access_token of WeChat is obtained by calling the corresponding interface through the AppID and AppSecret of the public account;

The access_token voucher when the Weibo fan service interface is called is in the Application message interface At this time, after the URL is verified successfully, the powder service platform will automatically return (as shown in the following figure);

In addition, the access_token certificate of Weibo's fan service interface can also be obtained through the OAuth2.0 authorization interface of Weibo, but this is currently under development and has not been launched yet;

As for the validity period, the access_token of WeChat is valid for 7200 seconds, which requires developers to constantly refresh; However, the access_token certificate of the Weibo fan service interface is valid for one year, and developers can find the Blue V account to rebind or authorize after one year;



For more information about Weibo access_token, see:

Difference 3: There are some differences in interface parameters

1. About receive messages and Send passive message Two functions, WeChat is in push XML format, and Weibo is in push JSON format by default, but Weibo is also compatible with WeChat XML format;

If third-party developers want to use WeChat XML compatible format, they can use the http://open.weibo.com/wiki/Eps/push/set_format Interface to switch between XML and JSON. For more details, refer to WeChat XML format compatible


2. About Send customer service message Function. The call parameters of WeChat are access_token, touser, msgtype and message content, and the corresponding parameters of Weibo are access_token, receiver_id, type and data fields; The ID and source fields in the document are mainly used to support the old version of fan service. New developers should ignore them;

Microblogging Send customer service message At present, the function only supports three types of formats: plain text, graphic message and location information;





Document update time: July 16, 2014