API description
This API is used to query the linkages between devices and pages. You can query all devices linked with a page by page ID,
or all the pages linked with a device by device ID or UUID+Major+Minor.
API Request Format
HTTP request method: POST (use the HTTPS protocol)https://api.weixin.qq.com/shakearound/relation/search?access_token=ACCESS_TOKEN
POST data format: json
POST data example:
Query pages linked with the specified device:
{
"type": 1,
"device_identifier": {
"device_id": 10011,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825",
"major": 1002,
"minor": 1223
}
}
Query devices linked with the specified page:
{
"type": 2,
"page_id": 11101,
"begin": 0,
"count": 3
}
Parameters
Parameter | Required | Description |
---|---|---|
access_token | Yes | The credential for calling the API |
type | Yes | Query type. 1: Query pages linked with the specified device; 2: Query devices linked with the specified page. |
device_identifier | 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. |
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. |
page_id | Yes | Specified page ID. It is required when "type" is 2. |
begin | Yes | Starting number of the device-page linkage list. It is required when "type" is 2. |
count | Yes | Number of device-page linkages to be queried. Maximum is 50. It is required when "type" is 2. |
Response
Example of JSON packet returned for a successful request:
{
"data": {
"relations": [
{
"device_id": 797994,
"major": 10001,
"minor": 10023,
"page_id": 50054,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
},
{
"device_id": 797994,
"major": 10001,
"minor": 10023,
"page_id": 50055,
"uuid": "FDA50693-A4E2-4FB1-AFCF-C6EB07647825"
}
],
"total_count": 2
},
"errcode": 0,
"errmsg": "success."
}
Parameters
Parameter | Description |
---|---|
relations | Device-page linkage list |
device_id | Device ID |
UUID, major, minor | UUID, major, minor |
page_id | Unique ID of the page pushed to users via the Shake-Nearby feature |
total_count | Total number of device-page linkages. |