Contents

1. Redirect from the Wi-Fi Connection Successful Page to Mini Program

2. Redirect from the Merchant Homepage to Mini Program

3. "Query Store Wi-Fi Information" API

# 1. Redirect from the Wi-Fi Connection Successful Page to Mini Program

Set the Wi-Fi Connection Successful Page API

Scenario: Set the Mini Program to be redirected to. By tapping Done after connecting to the Wi-Fi network, users can go to the configured Mini Program.

Note: Users can only be redirected to Mini Programs linked with the Official Account.

API Call
API Request Format

Protocol: HTTPS
HTTP request method: POST  
Request URL:  https://api.weixin.qq.com/bizwifi/finishpage/set?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:

{
  "shop_id": 429620,
  "finishpage_url": "",  
  "wxa_user_name": "gh_966b66e00888",  
  "wxa_path": "pages/index/index",  
  "finishpage_type": 1  
} 

Fields

Field Required Description
shop_name Yes Store name
finishpage_url No URL of the Wi-Fi connection successful page. This field is effective when finishpage_type is set to 0.
wxa_user_name No The original ID of the Mini Program redirected to from the Wi-Fi connection successful page. This field is effective when finishpage_type is set to 1. The Mini Program must be linked with the Official Account.
wxa_path No Path to the Mini Program redirected to from the Wi-Fi connection successful page. When finishpage_type is set to 1, this field is effective and must be URL-encoded.
finishpage_type No The page redirected to from the Wi-Fi connection successful page. 0: HTML5; 1: Mini Program.

# 2. Redirect from the Merchant Homepage to Mini Program

Scenario:

After connecting to a Wi-Fi network, a user can go to the preset Mini Program by tapping the greeting message on the "Chats" screen in Weixin to get information or services.

Note: Users can only be redirected to the Mini Programs linked with the Official Account.

API Call

API Request Format

Protocol: HTTPS
HTTP request method: POST  
Request URL: https://api.weixin.qq.com/bizwifi/homepage/set?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:

{
    "shop_id": 2200766,  
    "template_id": 2,  
    "struct": {  
        "wxa_user_name": "gh_5cb1b4334f3a",  
        "wxa_path": "index.html?query=abc"  
    }
}

Fields

Field Required Description
shop_id Yes Store ID
template_id Yes 2: Linked Mini Program (Store Mini Programs are supported)
struct Yes The original ID of the Mini Program redirected to from the Wi-Fi connection successful page. This field is effective when finishpage_type is set to 1. The Mini Program must be linked with the Official Account.
wxa_user_name Yes The original ID of the account
wxa_path Yes The path of a Mini Program page

# 3. "Query Store Wi-Fi Information" API

Scenario

API Request Format

Protocol: HTTPS
HTTP request method: POST  
Request URL: https://api.weixin.qq.com/bizwifi/shop/get?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:

{  
  "errcode": 0,  
  "data": {  
    "shop_name": "Nanshan Store",  
    "ssid": " WX123",  
    "ssid_list": [  
      "WX123",  
      "WX456"  
    ],  
    "ssid_password_list": [  
      {  
        "ssid": "WX123",  
        "password": "123456789"  
      },  
      {  
        "ssid": "WX456",  
        "password": "21332465dge"  
      }  
    ],  
    "password": "123456789",  
    "protocol_type": 4,  
    "ap_count": 2,  
    "template_id": 1,  
    "homepage_url": "http://www.weixin.qq.com/",  
    "bar_type": 1,  
    "sid":"",  
    "poi_id":"285633617",  
    "homepage_wxa_user_name":"",  
    "homepage_wxa_path":"",  
    "finishpage_url":"",  
    "finishpage_wxa_user_name":"gh_966b66e00888",  
    "finishpage_wxa_path":"pages/index/index",  
    "finishpage_type":1,  
  }  
}  

Fields

Field Required Description
shop_name Yes Store name
ssid Yes The SSID of the wireless network device. This field is left empty if no device is added. If there are more than one SSID, the first one is displayed.
ssid_list Yes The list of SSIDs of wireless network devices, which is returned in an array format.
ssid_password_list Yes A list of SSIDs and passwords (in array format). The password field is only available to password-based devices.
password Yes The password of the device. It is returned when the device type is password-based device.
protocol_type Yes The type of device in the store. 0: No device added; 4: Password-based device; 31: Portal-based device.
ap_count Yes Total number of devices in the store
template_id Yes Merchant homepage (bar) template type. 0: Default page; 1: Custom HTML5; 2: Redirect to Mini Program.
homepage_url Yes URL of the merchant homepage (bar)
bar_type Yes Text for the pinned entry on top: 0: Welcome to + Official Account name; 1: Welcome to + Store name; 2: Connected to + Official Account name + Wi-Fi; 3: Connected to + Store name + Wi-Fi.
finishpage_url Yes URL of the Wi-Fi connection successful page. This field is effective when finishpage_type is set to 0.
sid Yes Merchant ID, corresponding to the poi_id of the store. You are recommended to link it when adding a store. For details, see "Weixin Store APIs".
poi_id Yes Store ID (applicable to Weixin Cards & Offers and Weixin Store). See the Weixin Store documentation for details. A store ID corresponds to a shop_id.
homepage_wxa_user_name Yes The original ID of the Mini Program redirected to from the merchant homepage (bar). This field is effective when template_id is set to 2.
finishpage_wxa_user_name Yes The original ID of the Mini Program redirected to from the Wi-Fi connection successful page. This field is effective when finishpage_type is set to 1.
inishpage_wxa_path Yes Path to the Mini Program redirected to from the Wi-Fi connection succesful page. When finishpage_type is set to 1, this field is effective and must be URL-encoded.
finishpage_type Yes The page redirected to from the Wi-Fi connection successful page. 0: HTML5; 1: Mini Program.