The public platform is updated to provide the UnionID mechanism for developers. as multiple public accounts in a company need to communicate with each other, the open platform provides the UnionID mechanism to solve this problem. Public platform updates, providing developers with a UnionID mechanism
According to feedback from developers, as multiple public accounts in the same company need to communicate with each other, the open platform provides the UnionID mechanism to solve this problem.
Through the interface for obtaining basic user information, developers can obtain basic user information through OpenID. if a developer has multiple public accounts, you can use the UnionID mechanism to connect user accounts among multiple public accounts.
1. bind multiple public accounts to the same open platform (open.weixin.qq.com) account, that is, under the same Union
2. Identify the uniqueness of a user by obtaining the UnionID in the basic user information interface. However, note that the public account will only obtain the UnionID after it is bound to an open platform account. As long as it is a public account under the same open platform account, the user's UnionID is unique. In other words, UnionID is the same for different applications under the same open platform account.
I. register an open platform
Address: http://open.weixin.qq.com/
Process omitted.
2. bind a public account
Click "management center" on the top, select "public account", and click "bind public account"
Only authenticated public accounts can be bound.
3. obtain basic user information
This is achieved through obtaining basic user information in the advanced interface. for methods, refer to public platform development to obtain basic user information.
The user information obtained under the first public account is as follows:
{"Subscribe": 1, "openid": "oLVPpjqs9BhvzwPj5A-vTYAX3GLc", "nickname": "", "sex": 1, "language": "zh_CN ", "city": "Guangdong", "province": "Shenzhen", "country": "China", "headimgurl": "http://wx.qlogo.cn/mmopen/utpKYf69VAbCRDRlbUsPsdQN38DoibCkrU6SAMCSNx558eTaLVM8PyM6jlEGzOrH67hyZibIZPXu4BK1XNWzSXB3Cs4qpBBg18/0", "subscribe_time": 1375706487, "unionid": "oTBn-jt2RQSHdBoJQYFSdnZo8BBQ "}
The user information obtained under the first public account is as follows:
{"Subscribe": 1, "openid": "ouBMEj6WFnUFBIUKe83VD7s7dft9", "nickname": "times", "sex": 1, "language": "zh_CN ", "city": "Guangdong", "province": "Shenzhen", "country": "China", "headimgurl": "http://wx.qlogo.cn/mmopen/utpKYf69VAbCRDRlbUsPsdQN38DoibCkrU6SAMCSNx558eTaLVM8PyM6jlEGzOrH67hyZibIZPXu4BK1XNWzSXB3Cs4qpBBg18/0", "subscribe_time": 1375726425, "unionid": "oTBn-jt2RQSHdBoJQYFSdnZo8BBQ "}
Note two different user information
Openid is different under different public accounts, while their unionid is the same. Other information is not unique and has no comparative significance. However, the basic information is consistent.
In this way, we can see that the two public accounts are actually the same person.
IV. Significance of UnionID
For enterprises with multiple accounts, unionid can help identify whether users under different public accounts are the same person. In this way, the services provided to the user under different accounts can be continuously increased.
You can also remove the number of users who are paying attention to each other to collect statistics on the total number of users actually paying attention.
For more articles about UnionID development on the public platform, refer to the PHP Chinese website!