Manage the relationship between devices and pages


Configure the relationship between the device and the page

1475204329604291.png

Interface Description

When configuring, pass in the id list of the pages that the device needs to be associated with (the original association of the device will be cleared directly);

The id list is allowed to be empty. When the id list of the page is empty, all associations of the device will be cleared.

After the configuration is completed, the associated page information can be shaken out within the signal range of this device.

After applying for the device ID, you can directly use the interface to directly configure the page.

If the device is configured with multiple pages, page information will appear randomly. A device can be configured with up to 30 associated pages.

Interface calling instructions

http request method: POST (please use https protocol) https://api. weixin.qq.com/shakearound/device/bindpage?access_token=ACCESS_TOKENPOST data format: json
POST data example:
{
"device_identifier":{
"device_id":10011,
"uuid":"FDA50693-A4E2-4FB1-AFCF-C6EB07647825",
"major":1002,
"minor":1223
},
"page_ids":[12345, 2345 6, 334567]
}

Parameter Description

ParameterIs it requiredDescription
access_token is the calling interface credential
page_idsisList of pages to be associated
device_identifierisThe device ID of the specified page
device_id isDevice number. If UUID, major, and minor are filled in, the device number is not required. If both are filled in, the device number takes priority.
UUID, major, minor is UUID, major, minor. The three information must be filled in completely. If If you don’t have the device number, you don’t need to fill in this information

Return instructions

Example of normal returned JSON data packet:

{
"data": {
},
"errcode": 0,
"errmsg": "success."
}
Query the relationship between the device and the page

Interface description

Query the relationship between the device and the page. Two query methods are provided. You can specify the page ID to query all device information associated with the page in pages;

You can also query the device based on the device ID or complete UUID, Major, and Minor. All associated page information.

Interface calling instructions

http request method: POST (please use https protocol) https://api. weixin.qq.com/shakearound/relation/search?access_token=ACCESS_TOKENPOST data format: json
POST data example:
When querying the page associated with the specified device:
{
"type": 1,
"device_identifier": {
"device_id": 10011,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825",
"major": 1002,
"minor": 1223
}
}
When querying the device associated with the page:
{
"type": 2,
"page_id": 11101,
"begin": 0,
"count": 3
}

Parameter Description

##page_idyes
ParameterIs it requiredDescription
access_token is the calling interface credential
typeisinquiry mode.1: Query the association relationship of the device; 2: Query the association relationship of the page
device_identifier## is Specified device; when type is 1, this item is required
device_id is the device number. If UUID, major, and minor are filled in, the device number does not need to be filled in. If both are filled in, the device number takes precedence
UUID, major, minor isUUID, major, minor, three pieces of information need to be filled in completely. If the device number is filled in, this information does not need to be filled in
Specified page id; when type is 2, this item is required
begin is the starting index value of the association list; when type is 2, this item is required
count is the number of associations to be queried, which cannot exceed 50; when type is 2 , this item is required

Return instructions

Example of normal return JSON data packet:

{
"data": {
"relations": [
"{
"device_id": 797994,
"major": 10001,
"minor": 10023,
               "page_id ": 50054,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
},
"uuid": "device_id": 797994,
"major": 10001,
"minor": 10023,
"page_id": 50055,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
}
],
"total_count" : 2
},
"errcode": 0,
"errmsg": "success."
}

Parameter Description

ParametersDescription
relationsAssociation list
device_idDevice number
UUID、major、minorUUID、major、minor
page_idShake the unique ID of the surrounding page
# #total_countTotal number of device or page associations

##