Contents

1. Activating the Wi-Fi via Weixin Plug-in

2. Activation Process

3. Process Details

3.1 1. User Goes to the Third-party Platform's Website and Logs in via Authorization

3.2 2. The Third-party Platform Gets Plug-in's wifi_token

3.3 3. Guide User to the Plug-in Activation Page

3.4 4. User Enters Information and Activates Plug-in

3.5 5. Redirect to callback_url

# Activating the Wi-Fi via Weixin Plug-in

To call all other APIs of Wi-Fi via Weixin, you must activate the "Wi-Fi via Weixin" plug-in by using either of the following ways: (1) Add the Wi-Fi via Weixin plug-in on the Weixin Official Accounts Platform by performing relevant operations. (2) Activate the plug-in by calling this API.

Note: Since the activated plug-in can only be called by third-party platforms, Official Accounts developers need to activate the plug-in on the Weixin Official Accounts Platform. For information on how to access a third-party platform, please see the Weixin Open Platform.

# Activation Process

# Process Details

# 1. User Goes to the Third-party Platform's Website and Logs in via Authorization

The user first needs to go to a third-party platform's website, such as www.ABC.com. The third-party platform then guides the user to log in via Weixin Official Account authorization.

# 2. The Third-party Platform Gets Plug-in's wifi_token

Protocol: HTTPS
HTTP request method: GET
Request URL: https://api.weixin.qq.com/bizwifi/openplugin/token?access_token=ACCESS_TOKEN
POST data format: JSON

Request Parameters

Parameter Required Description
access_token Yes The credential for calling the API
POST data Yes JSON data

POST Data

Example:

{
   "callback_url": "http://weixin.qq.com/"
}

Fields:

Field Required Description
callback_url Yes Callback URL to the page to redirect to after the plug-in is activated successfully. Note: The domain name of this parameter must be the same with that of the plug-in activation page. A third-party platform domain name is recommended.

Response Data An example of returned JSON packet for a successful request:

{
  "errcode": 0,
  "data": {
     "is_open": true,
     "wifi_token": ""
  }
}

Fields:

Field Description
is_open Indicates whether the Wi-Fi via Weixin plug-in has been activated for the Official Account. true: Yes; false: No.
wifi_token The credential for plug-in activation. This value is returned when is_open is set to false.

# 3. Guide User to the Plug-in Activation Page

The third-party platform can add the entry to "Activate Wi-Fi via Weixin" in its webpage to guide users to the plug-in activation page. It is recommended to allow users to open the plug-in activation page over the current page.

URL: https://wifi.weixin.qq.com/biz/mp/thirdProviderPlugin.xhtml?token=xxxx, where the third-party platform needs to provide the obtained wifi_token.

# 4. User Enters Information and Activates Plug-in

The user needs to enter relevant information on the plug-in activation page to activate the plug-in.

# 5. Redirect to callback_url

After the plug-in is activated, the page automatically redirects to the callback_url provided when the third-party platform calls the "Get Plug-in's wifi_token" API to complete the activation process. Then, the third-party platform can call other APIs to provide the Wi-Fi via Weixin service for users.