rthoogl.blogg.se

Wechat official account api
Wechat official account api










wechat official account api

When a user who've already followed the Official Account is redirected to the authorization page from an Official Account chat or the Official Account's custom menu, even if the scope is set as snsapi_userinfo, authorization is silent and not perceived by the user. Silent authorization in special scenariosĪs mentioned above, webpage authorization initiated with snsapi_base as the scope is silent and not perceived by the user. UnionID mechanism: If you have multiple mobile apps, web apps, and Official Accounts, you can uniquely identity the user by getting the UnionID in the user's basic information, as the user's UnionID is unique across all the mobile apps, web apps and Official Accounts under the same Weixin Open Platform. You need to go to the Weixin Open Platform (.com) to link the Official Account before you can make a user account consistent between multiple Official Account, or between the Official Account and Apps, using the UnionID mechanism. Note that you must follow the UnionID mechanism to get basic user information via webpage authorization.

wechat official account api

Other Weixin APIs have to use the "Get access_token" API in the Basic Support to get the ordinary access_token. After a user grants authorization to an Official Account, the Official Account can get a credential to call the webpage authorization-specific API (webpage authorization access_token) for operations such as getting basic user information. Weixin webpage authorization uses the OAuth2.0 mechanism. the openID) follows the Official Account.ĭifferences between the webpage authorization access_token and ordinary access_token This API includes other Weixin APIs, and all of them can only be successfully called after the user (i.e.

wechat official account api

The "Get Basic User Information" API in the user management class APIs gets basic user information based on the user's OpenID only after the user and Official Account exchange messages or an event is pushed when the user follows the official account. Users are required to manually agree to such authorization, so that their basic information can be obtained without them having to follow the account. The webpage authorization initiated with snsapi_userinfo as the scope is used to obtain the basic information of users who access the page. What users perceive is direct access to the callback page (often the business page). It is a silent authorization and will automatically redirect to the callback page. The webpage authorization initiated with snsapi_base as the scope is used to obtain the openid of users who access the page. The third-party will implement webpage authorization on behalf of the Official Account.ĭifferences between the two scopes for webpage authorization If an Official Account grants login authorization to a third-party developer for management, no settings are required. For example, if a domain name requiring webpage authorization is you can perform OAuth 2.0 authentication on the sub-domain pages and after configuration, but cannot do so on, , and.

#WECHAT OFFICIAL ACCOUNT API FULL#

The authorization callback domain name should be configured as a full domain name. Note that this should be filled in with a domain name (which is a string) instead of a URL, so do not add or other protocol headers here.

wechat official account api

The webpage authorization callback domain nameīefore the Weixin Official Account requests the webpage authorization from a user, the developer must first go to the Official Accounts Platform, navigate to the configuration options in Development > API Authorization > Webpage Service > Webpage Account > Get Basic User Information via Webpage Authorization, and modify the authorization callback domain name. If a user visits a third-party webpage in the Weixin app, the Official Account can get the user's basic information using Weixin webpage authorization mechanism to realize its business logic.












Wechat official account api