This API is used to add the network information of a portal-based device and to get the secretkey. The secretkey, an encrypted string, is a key parameter used for modifying portal-based devices. You can use this API to reset and refresh the secretkey to prevent it from disclosure, and the previous secretkey will become invalid thereafter. Please note the following:

  1. A maximum of 100 SSIDs can be added to a store.

  2. A store can have only one device type. Once this API is called to add an SSID, the store's device type is modified as portal-based device. If the store has a non-portal-based device, then this API is not available.

API Request Format

Protocol: HTTPS
HTTP request method: POST
Request URL:
POST data format: JSON

Request Parameters

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



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


Field Required Description
shop_id Yes Store ID
ssid Yes The SSID of the wireless network device. This field consists of up to 30 characters. Avoid using Chinese characters to prevent garbled characters or connection failures due to device compatibility issues.
reset No Indicates whether to reset the secretkey. false: No (default); true: Yes.


The JSON data returned for a successful request:

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


Field Description
secretkey This parameter is required to modify the portal page. It is used to trigger the calculation of the sign parameter in the JSAPI API that is called to invoke Weixin.


After adding a device, modify the device according to the Hardware Authentication Protocol API Description. Otherwise, Wi-Fi via Weixin is not available.