Wi-Fi device management


Add password type device

1475894603961331.png

Call this interface to add the Wi-Fi information of the password-type device to the designated store. To ensure seamless roaming of multiple devices in the store.

1. You can add multiple SSIDs to the same store, with a maximum of 100 SSIDs;

2. Already The ssid that has been added cannot be added again;

3. A store can only have one device type. As long as you call this interface to add a ssid, the store will have the password Type device , cannot add portal type device . Call Clear StoreWi-FiInformation InterfaceAfter clearing the network information, you can set it to other types of devices .


Note: After calling this interface, the following two steps are required to officially enable the device

1. Enter the management background of the wireless router, modify the SSID and password of the device to be added, and ensure that the SSID and password of the device are consistent with those filled in when calling the interface

2. Please be sure to call the "Get Material QR Code" interface to download the store QR code and post it in the store. And make sure someone (customer or store clerk) uses WeChat for Android 6.1 or above or WeChat for IOS 6.2.2 or above to scan the QR code to connect to Wi-Fi. Successful connection means the device has been added successfully.


Interface call description

协议:https
http请求方式: POST
请求URL:https://api.weixin.qq.com/bizwifi/device/add?access_token=ACCESS_TOKEN
POST数据格式:JSON

Request parameter description

ParameterIs it requiredDescription
access_tokenYes Call interface credentials
POST data isJSON data

POST data

Data example:

{
  "shop_id": 429620,
  "ssid": "WX123",
  "password": "12345689",
}

Field description:

FieldRequiredDescription
shop_id isStore ID
ssid is the ssid of the wireless network device. One of the ssid and password must start with the capital letters "WX" and be within 32 characters; the ssid supports Chinese, but it may display garbled characters or be unable to connect due to device compatibility issues, and you are responsible for the relevant risks !
password is the password of the wireless network device. 8-24 characters; cannot contain Chinese characters; one of the ssid and password must start with the capital letter "WX"

Return data description

Example of correctly returning JSON data:

{
  "errcode": 0
}


Note: After adding the device, be sure to call "Get material QR code" interface, download the QR code of the store and post it in the store. And make sure that someone (customer or store clerk) uses WeChat for Android 6.1 or above or WeChat for IOS 6.2.2 or above to scan the QR code to connect to Wi-Fi. Successful connection means the device has been added successfully.


Add portal device

#Calling the following interface can add the network information of the portal device and obtain the secretkey. secretkey is an encrypted string parameter and is an important parameter in the portal device transformation process. To prevent secretkey leakage, you can reset and refresh through this interface. After reset, the previously generated secretkey will become invalid. Note:

1. You can add multiple ssid to the same store, the maximum number is 100ssid;

2. One store only You can have one type of equipment. As long as you call this interface and add a ssid, the store will be a portal type transformation equipment. If there is a non-portal device under the store, this interface cannot be called.

Interface calling instructions

协议:https
http请求方式: POST
请求URL:https://api.weixin.qq.com/bizwifi/apportal/register?access_token=ACCESS_TOKEN
POST数据格式:JSON

Request parameter description

ParameterIs it necessaryDescription
access_token is Calling interface credentials
POST data is JSON data

POST data

Data example:

{
   "shop_id": 429620,
   "ssid": "WX123",
   "reset": false
}

Field description:

FieldRequiredDescription
shop_id isStore ID
ssid is the ssid of the wireless network device, limited to 30 characters. ssid supports Chinese, but it may display garbled characters or be unable to connect due to device compatibility issues. You are responsible for the relevant risks!
resetNoReset secretkey, false-no reset, true-reset, default is false

Return data description

Correctly returned JSON data example:

{
   "errcode": 0,
   "data": {
     "secretkey": "1af08ec5cdb70a4d7365bcd64d3120f6"
   }
}

Field description:


FieldDescription
secretkeyRenovate the portal page Required parameters, which are used to trigger the calculation of the sign parameter value of the JSAPI interface that calls up WeChat



Notice:

After adding the device, be sure to modify the device in accordance with the Authentication Protocol Interface, otherwise the WeChat connection to Wi-Fi will not be possible.

Query device


可通过指定分页或具体门店ID的方式,查询当前MP账号下指定门店连网成功的设备信息。一次最多能查询20个门店的设备信息。

接口调用说明

协议:https
http请求方式: POST
请求URL:https://api.weixin.qq.com/bizwifi/device/list?access_token=ACCESS_TOKEN
POST数据格式:JSON

Request parameter description

ParameterIs it necessaryDescription
access_token is Calling interface credentials
POST data is JSON data

POST data

Data example:

分页查询时:
{
   "pageindex": 1,		
   "pagesize":10
}
根据门店ID查询时:
{
   "pageindex": 1,		
   "pagesize":10,
   "shop_id":429620
}

Field description:

FieldRequiredDescription
pageindexNoPage subscript, starting from 1 by default
pagesizeNoNumber of pages per page, default 10, maximum 20
shop_idNoQuery based on store ID

Return data description

Correctly returned JSON data example:

{
   "errcode": 0,
   "data": {
     "totalcount": 2,
     "pageindex": 1,
     "pagecount": 1,
     "records": [
       {
         "shop_id": 429620,
         "ssid": "WX123",
         "bssid": "00:1f:7a:ad:5b:a9",
         "protocol_type":4
       },
       {
         "shop_id": 429620,
         "ssid": "WX123",
         "bssid": "00:1f:7a:ad:5c:a8",
         "protocol_type":4
       }
     ]
   }
}

Field description:

##pageindexPaging indexpagecountNumber of paging pagesrecordsCurrent page list arrayshop_idStore IDssidConnected device ssid bssidWireless MAC addressprotocol_typeThe device type of the device in the store, 0-no device added, 4-password device, 31- Portal type equipment

Delete device

Delete a single device under the store based on bssid. After deletion, please change the network name and password of the device as soon as possible, or stop using the device, otherwise the device will be automatically re-added. If you need to clear the store network and all devices, please call the "Clear Store Network and Devices" interface.

Interface call description

协议:https
http请求方式: POST
请求URL:https://api.weixin.qq.com/bizwifi/device/delete?access_token=ACCESS_TOKEN
POST数据格式:JSON

Request parameter description

Field Description
totalcountTotal count

##

POST data

Data example:

{
  "bssid":"00:1f:7a:ad:5c:a8"
}

Field description:

ParameterIs it requiredDescription
access_tokenYesCall interface credentials
POST data isJSON data

Return data description

Example of correctly returning JSON data:

{
   "errcode": 0
}





#
FieldRequiredDescription
bssid is the wireless mac address of the wireless network device that needs to be deleted, in the format colon Delimited, the length is 17 characters, and the letters are lowercase, for example: 00:1f:7a:ad:5c:a8