API Description

Queries the existing device ID, UUID, Major, Minor, activation status, remarks, linked stores, linked pages, and more. You can query the information by specifying the device ID or the complete UUID, Major, Minor, or you can fetch the device information list in batches. The device list returned by the query is sorted by device IDs in ascending order.

API Request Format

HTTP request method: POST (use the HTTPS protocol)https://api.weixin.qq.com/shakearound/device/search?access_token=ACCESS_TOKENPOST

Data format: JSON POST Data example: Query the specified device:

{
    "type": 1,
    "device_identifiers":[
 	{
	"device_id":10100,
	"uuid":"FDA50693-A4E2-4FB1-AFCF-C6EB07647825",
	"major":10001,
	"minor":10002
	} ]
    } Query by page or query devices within the specified range:{
    "type": 2,
    "last_seen": 10097,
    "count": 3
     } Query based on the batch ID: {
    "type": 3,
    "apply_id": 1231,
    "last_seen": 10097,
    "count": 3
 }

Parameters

Parameter Required Description
access_token Yes The credential for calling the API
type Yes Query type. 1: Query the device in the device ID list; 2: Query all device information by page; 3: Query all device information of a certain application by page.
device_identifiers Yes Specified device. It is required when "type" is 1.
device_id Yes Device ID. If UUID+major+minor is entered, device ID is optional. If both are entered, device ID is preferred. When specified devices are queried, a maximum of 50 devices can be queried at a time.
UUID, major, minor Yes If device ID is entered, this parameter is optional. If device ID is left empty, all the three parts of the parameter are required. When specified devices are queried, a maximum of 50 devices can be queried at a time.
apply_id Yes Batch ID returned when applying for device ID. It is required when "type" is 3.
last_seen Yes The device ID at the end of the previous query list. For the first query, last_seen is 0.
count Yes The number of devices to be queried. Maximum is 50.

Response

Example of JSON packet returned for a successful request:


{
    "data": {
        "devices": [
            {
                "comment": "",
                "device_id": 10097,
                "major": 10001,
                "minor": 12102,
                "status": 1,
                "last_active_time":1437276018,
                "poi_id": 0,
                "uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
            },
            {
                "comment": "",
                "device_id": 10098,
                "major": 10001,
                "minor": 12103,
                "status": 1,
                "last_active_time":1437276018,
                "poi_appid":"wxe3813f5d8c546fc7"
                "poi_id": 123,
                "uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
            }
         ],
        "total_count": 151
    },
    "errcode": 0,
    "errmsg": "success."}

Parameters

Parameter Description
devices Specified device information list
device_id Device ID
UUID, major, minor UUID, major, minor
status Activation status. 0: Not activated, 1: Activated.
last_active_time The date that the device was last popped up by shaking (It can only obtain the data of the previous day); for newly applied devices, the field value is 0.
poi_appid If the device has been linked with the store of another Official Account, the appid of the Official Account to which the store belongs is returned. View "Link the device with the store of another Official Account" API.
poi_id The store ID linked with the device. Information can be preferentially obtained via the Shake-Nearby feature within the range of 1KM. For more information about the store, see the API documentation related to the store.
comment Remarks of the device
total_count Total number of the devices under the merchant name.