有奖捉虫:办公协同&微信生态&物联网文档专题 HOT

1. 接口描述

接口请求域名: iot.cloud.tencent.com/api/exploreropen/tokenapi。 本接口(AppGetFenceList)用于获取设备地理围栏列表。

2. 输入参数

名称
类型
必选
描述
AccessToken
String
公共参数,AccessToken 用于对一个已经登录的用户鉴权。
RequestId
String
公共参数,唯一请求 ID,可自行生成,推荐使用 uuId。定位问题时,需提供该次请求的 RequestId。
Action
String
公共参数,本接口取值:AppGetFenceList。
ProductId
String
产品 ID。
DeviceName
String
设备名称。
Offset
Int
消息偏移量。
Limit
Int
最大返回消息条数,最大值为 50。

3. 输出参数

名称
类型
描述
RequestId
String
公共参数,唯一请求 ID,与入参相同,定位问题时,需提供该次请求的 RequestId。
List
Array of Fence
设备地理围栏列表。

4. 示例

输入示例
POST https://iot.cloud.tencent.com/api/exploreropen/tokenapi HTTP/1.1
content-type: application/json
{
"RequestId": "req_1",
"Action": "AppGetFenceList",
"ProductId": "NJ****T4",
"DeviceName": "gw****ev",
"Offset": 0,
"Limit": 10,
"AccessToken": "8b4a70dd16105f******************18edd4e78a3bb8ec"
}
输出示例: 成功
{
"Response": {
"List": [
{
"FenceId": 8,
"FenceName": "appFence",
"FenceDesc": "test",
"FenceArea": "{\\"type\\":\\"FeatureCollection\\",\\"features\\":[{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Polygon\\",\\"coordinates\\":[[[113.9498,22.5319],[113.9709,22.5319],[113.9709,22.5723],[113.9498,22.5723],[113.9498,22.5319]]]},\\"properties\\":null}]}",
"AlertCondition": "leave",
"FenceEnable": true,
"Method": "app push",
"CreateTime": 1604314065,
"UpdateTime": 1604314065
}
],
"RequestId": "req_1"
}
}

5. 错误码

错误码
描述
InternalError
内部错误。
InternalError.InternalServerExceptionDB
DB 错误。
InvalidParameterValue
参数取值错误。
InvalidParameterValue.InvalidAccessToken
Token 无效。