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

1. 接口描述

接口请求域名: iot.cloud.tencent.com/api/exploreropen/tokenapi。 本接口(AppGetDeviceLocationHistory)用于获取蜂窝网络设备的历史位置。

2. 输入参数

名称
类型
必选
描述
AccessToken
String
公共参数,用户通过微信号、手机或邮箱账号登录成功后,获取的访问 Token。
RequestId
String
公共参数,唯一请求 ID,可自行生成,推荐使用 uuid。定位问题时,需提供该次请求的 RequestId。
Action
String
公共参数,本接口取值:AppGetDeviceLocationHistory。
DeviceId
String
设备 ID , 由 ProductId/DeviceName 拼接组成。
MinTime
int
查询开始时间(毫秒级 UNIX 时间戳),支持最近1个月范围。
MaxTime
int
查询结束时间(毫秒级 UNIX 时间戳),支持最近1个月范围。

3. 输出参数

名称
类型
描述
RequestId
String
公共参数,唯一请求 ID,与入参相同。
Data
Array of Position
位置列表。

4. 示例

输入示例
POST https://iot.cloud.tencent.com/api/exploreropen/tokenapi HTTP/1.1
content-type: application/json
{
"RequestId": "req_1",
"Action": "AppGetDeviceLocationHistory",
"DeviceId": "QDA******B/de******01",
"MaxTime": 0,
"MinTime": 0
"AccessToken": "8b4a70dd16105f******************18edd4e78a3bb8ec"
}
输出示例: 成功
{
"Response": {
"Data": {
"Ret": 0,
"ErrMsg": "",
"Pos": [{
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013554000000000
}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013569000000000
}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013574000000000
}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013579000000000
}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013604000000000
}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013609000000000

}, {
"Location": {
"Longitude": 102.83191,
"Latitude": 24.325504
},
"CreateTime": 1599013684000000000
}]
},
"RequestId": "aaabbbb2"

}
}

5. 错误码

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