After a customer connects to the Wi-Fi network in a store, the event of successful network connection will be pushed to the developer who will then send a text message or a coupon to the customer via the Official Account by calling the Customer Service Messages API.

The event will be sent to the URL entered by the developer in the Official Accounts Platform Developer Center.

If the WeChat server does not receive the response within five seconds, the connection is broken and the request is initiated again. A maximum of three retries are made.

It is recommended to use FromUserName + CreateTime for de-duplication of requests.

If the merchant's server cannot ensure the request is processed and responded within five seconds, it can return an empty string. When receiving the string, the WeChat server will not take any action or make a retry.

Example of XML packet:

<xml> 
<ToUserName><![CDATA[toUser]]></ToUserName> 
<FromUserName><![CDATA[FromUser]]></FromUserName> 
<CreateTime>123456789</CreateTime> 
<MsgType><![CDATA[event]]></MsgType> 
<Event><![CDATA[WifiConnected]]></Event> 
<ConnectTime>0</ConnectTime>
<ExpireTime>0</ExpireTime>
<VendorId>![CDATA[3001224419]]</VendorId>
<ShopId>![CDATA[PlaceId]]</ShopId>
<DeviceNo>![CDATA[DeviceNo]]</DeviceNo>
</xml>

Parameters:

Parameter Description
ToUserName Developer's WeChat ID
FromUserName The account ID (OpenID) of a user who connects to the Wi-Fi network
CreateTime Message creation time (integer)
MsgType Message type: event
Event Event type. WifiConnected indicates the Wi-Fi network is connected successfully.
ConnectTime Time when the Wi-Fi network is connected (integral)
ExpireTime System reserved field. It is a fixed value.
VendorId System reserved field. It is a fixed value.
ShopId Store ID (shop_id)
DeviceNo Wireless MAC address of the connected device, corresponding to bssid.