群名称:智启联云技术交流群
群 号:602952071
http接口
用户登录
请求:
http://api.uddgps.com/UserLogin?username=4gtest&password=123456
Get参数 | 含义 |
username | 用户名 |
password | 密码 |
响应:
{
"Result": "ok",
"Message": "UserLoginSuccess",
"SessionId": "5665509C186DED95ED6D89EE1939D83F",
"AliasBool": false
}
Json字段 | 含义 |
Result | 状态 |
Message | 状态码 |
SessionId | 会话ID |
AliasBool |
设备与分组数据
请求:
http://api.uddgps.com/LoadDeviceAndGroupFromCache?selaccount=4gtest&SessionId=FDF11A0009516124B2004DBD92ECC506&getgps=no&norequest=yes
Get参数 | 含义 |
SessionId | 会话ID |
selaccount | 账号 |
getgps | yes:返回gps数据 no:不返回gps数据 |
norequest | yes:不下发立即定位指令 空或无次参数:下发立即定位指令 |
响应:
{
"Result": "ok",
"Message": "",
"Username": "4gtest",
"DeviceInfoArray": [{
"Id": 230,
"Username": "4gtest",
"Classid": 0,
"DeviceNo": "869756049340471",
"UWBMAC": "",
"DeviceName": "CFIOT_EC20",
"DeviceIcon": "arrow",
"Remark": "",
"Pilot_name": "",
"Pilot_phone": "",
"Terminal_phone": "",
"Correctionvalue": 8,
"Timezonevalue": 8,
"Area": "",
"Endtime": "2020-03-19 00:00:00",
"Fencename": "",
"FenceLongitude": 0,
"FenceLatitude": 0,
"FenceLongitude1": 0,
"FenceLatitude1": 0,
"FenceLongitude2": 0,
"FenceLatitude2": 0,
"Fenceradius": 200,
"Fenceallow": 0,
"ProtocolType": "tianqin_osk",
"ManufacturerMark": "",
"ShareMark": false,
"App_Healthy_parameter": "100|60|140|130|100|90|90|85|65|60",
"Filter_lbs_wifi": "1|0",
"BatteryMaxVoltage": 0,
"BatteryMinVoltage": 0,
"Follow": 1
}, {
"Id": 231,
"Username": "4gtest",
"Classid": 0,
"DeviceNo": "865324039996820",
"UWBMAC": "",
"DeviceName": "Neoway_N720",
"DeviceIcon": "lx_b",
"Remark": "",
"Pilot_name": "",
"Pilot_phone": "",
"Terminal_phone": "",
"Correctionvalue": 8,
"Timezonevalue": 8,
"Area": "",
"Endtime": "2039-03-20 00:00:00",
"Fencename": "",
"FenceLongitude": 0,
"FenceLatitude": 0,
"FenceLongitude1": 0,
"FenceLatitude1": 0,
"FenceLongitude2": 117.2428,
"FenceLatitude2": 31.84674,
"Fenceradius": 56982,
"Fenceallow": 1,
"ProtocolType": "gsms",
"ManufacturerMark": "",
"ShareMark": false,
"App_Healthy_parameter": "100|60|140|130|100|90|90|85|65|60",
"Filter_lbs_wifi": "1|1",
"BatteryMaxVoltage": 0,
"BatteryMinVoltage": 0,
"Follow": 1
}, {
"Id": 331,
"Username": "4gtest",
"Classid": 0,
"DeviceNo": "9170951424",
"UWBMAC": "",
"DeviceName": "9170951424",
"DeviceIcon": "arrow",
"Remark": "",
"Pilot_name": "",
"Pilot_phone": "",
"Terminal_phone": "",
"Correctionvalue": 8,
"Timezonevalue": 8,
"Area": "",
"Endtime": "2020-08-16 00:00:00",
"Fencename": "",
"FenceLongitude": 0,
"FenceLatitude": 0,
"FenceLongitude1": 0,
"FenceLatitude1": 0,
"FenceLongitude2": 0,
"FenceLatitude2": 0,
"Fenceradius": 200,
"Fenceallow": 0,
"ProtocolType": "tianqin_osk",
"ManufacturerMark": "",
"ShareMark": false,
"App_Healthy_parameter": "100|60|140|130|100|90|90|85|65|60",
"Filter_lbs_wifi": "1|0",
"BatteryMaxVoltage": 0,
"BatteryMinVoltage": 0,
"Follow": 0
}],
"ClassInfoaArray": [{
"Id": -2,
"Username": "4gtest",
"Classname": "Share Group"
}, {
"Id": 147,
"Username": "4gtest",
"Classname": "Default Group"
}],
"GpsDatakey": {}
}
Json字段 | 含义 |
Result | 状态 |
Message | 消息名 |
Username | 账号名 |
DeviceInfoArray | 设备列表,设备信息结构见表1 |
ClassInfoaArray | 分组列表,分组信息结构见表2 |
GpsDatakey | 设备的gps数据,设备号作为KEY,VALYE值结构见GPS数据章节中的表1 |
表1
Json字段 | 含义 |
Id | 设备数据库ID号 |
Username | 账号名 |
Classid | 分组ID |
DeviceNo | 设备号 |
UWBMAC | UWB标签MAC地址 |
DeviceName | 设备名称 |
DeviceIcon | 设备图标 |
Remark | 备注信息 |
Pilot_name | 联系人 |
Pilot_phone | 联系电话 |
Terminal_phone | 设备sim卡号 |
Correctionvalue | 设备时间纠偏值 |
Timezonevalue | 设备所在地时区 |
Area | 设备地区编码 |
Endtime | 设备服务到期时间 |
Fencename | 设备圆形围栏名称 |
FenceLongitude | 围栏经度 |
FenceLatitude | 围栏纬度 |
FenceLongitude1 | 围栏经度(google坐标) |
FenceLatitude1 | 围栏纬度(google坐标) |
FenceLongitude2 | 围栏经度(百度坐标) |
FenceLatitude2 | 围栏纬度(百度坐标) |
Fenceradius | 围栏半径 |
Fenceallow | 0:禁用设备围栏 1:启用设备围栏 |
ProtocolType | 设备协议类型 |
ManufacturerMark | |
ShareMark | 设备是否共享 |
App_Healthy_parameter | 健康参数 |
Filter_lbs_wifi | 基站/wifi过滤 |
BatteryMaxVoltage | 电池充满电压 |
BatteryMinVoltage | 电池工作最低电压 |
Follow | 0:非关注 1:关注设备 |
表2
Json字段 | 含义 |
Id | 分组数据库ID号 |
Username | 账号名 |
Classname | 分组名称 |
GPS缓存数据
请求:
Get参数 | 含义 |
funcname | 回掉函数名,可选 |
FirstRequest | true:返回全部设备缓存位置 False:返回在线设备缓存位置 |
SessionId | 会话ID |
selaccount | 账号 |
响应:
{
"Result": "ok",
"Message": "",
"Username": "4gtest",
"GpsDatakey": {
"862607059076223": {
"DeviceNo": "862607059076223",
"Ltype": 0,
"Online": 1,
"Longitude": 117.23088,
"Latitude": 31.84247,
"Longitude1": 117.23636,
"Latitude1": 31.84046,
"Longitude2": 117.24279,
"Latitude2": 31.84682,
"N_S": "N",
"E_W": "E",
"Speed": 0,
"Direction": 250,
"Mode": "A",
"DateTime": "2021-06-25T01:56:20Z",
"DateTime1": "2021-06-25 01:56:20",
"ReceiveTime": "2021-06-30T22:40:51.135536549+08:00",
"ReceiveTime1": "2021-06-30 22:40:51",
"Battery": -1,
"BatteryVoltage": 0,
"Oilquantity": -1,
"Acc": 0,
"Address": "",
"AddressUpdatetime": "0001-01-01T00:00:00Z",
"StayTime": 0,
"NextBootTime": "",
"Shefangchefang": 0,
"MainPower": 0,
"LbsData": null,
"WifiData": [],
"CustomData": ""
}
},
"AlarmDatakey": {}
}
Json字段 | 含义 |
Result | 状态 |
Message | 消息名 |
Username | 账号名 |
GpsDatakey | 设备的gps数据,设备号作为KEY,VALYE值结构见表1 |
AlarmDatakey | 设备的报警数据,设备号作为KEY,VALYE值结构见表2 |
表1
Json字段 | 含义 |
DeviceNo | 设备号 |
Ltype | 基站定位标识,0:gps,1:lbs,2:wifi |
Online | 在线离线状态,0:离线,1:在线 |
Longitude | Gps经度 |
Latitude | Gps纬度 |
Longitude1 | Gps经度(google) |
Latitude1 | Gps纬度(google) |
Longitude2 | Gps经度(baidu) |
Latitude2 | Gps纬度(baidu) |
N_S | S:南纬,N:北纬 |
E_W | E:东经,W:西经 |
Speed | 速度 |
Direction | 方向 |
Mode | 定位状态,A:GPS有效,V:GPS无效 |
DateTime1 | GPS时间 |
ReceiveTime1 | 信号时间 |
Battery | 剩余电量 |
Acc | ACC状态 |
StayTime | 停留时间 |
LbsData | 基站数据 |
WifiData | Wifi数据 |
表2
Json字段 | 含义 |
DeviceNo | 设备号 |
DeviceName | 设备名称 |
AlarmType | 报警类型,定义见表3 |
Longitude | Gps经度 |
Latitude | Gps纬度 |
Longitude1 | Gps经度(google) |
Latitude1 | Gps纬度(google) |
Longitude2 | Gps经度(baidu) |
Latitude2 | Gps纬度(baidu) |
Speed | 速度 |
Direction | 方向 |
Mode | 定位状态,A:GPS有效,V:GPS无效 |
GpsTime1 | 定位时间 |
AlarmTime1 | 报警时间 |
OfflineTimeout | 离线超时时间 |
AlertInfo | 报警提示 |
FileName | 图片或视频文件路径 |
表3
报警类型 | 报警描述 |
1 | 震动报警 |
2 | 断电报警 |
3 | 低电报警 |
4 | 求救报警 |
5 | 进围栏报警 |
6 | 出围栏报警 |
7 | 超速报警 |
8 | 位移报警 |
9 | 拆除报警 |
10 | 离线报警 |
11 | 指令收到提醒报警 |
设备最后位置
请求:
Get参数 | 含义 |
deviceno | 设备编号 |
SessionId | 会话ID |
响应:
{
"Result": "ok",
"Message": "",
"DeviceNo": "84381128040",
"DeviceInfo": {
"Id": 0,
"Username": "",
"Classid": 0,
"DeviceNo": "",
"UWBMAC": "",
"DeviceName": "",
"DeviceIcon": "",
"Remark": "",
"Pilot_name": "",
"Pilot_phone": "",
"Terminal_phone": "",
"Correctionvalue": 0,
"Timezonevalue": 0,
"Area": "",
"Endtime": null,
"Fencename": "",
"FenceLongitude": 0,
"FenceLatitude": 0,
"FenceLongitude1": 0,
"FenceLatitude1": 0,
"FenceLongitude2": 0,
"FenceLatitude2": 0,
"Fenceradius": 0,
"Fenceallow": 0,
"ProtocolType": "",
"ManufacturerMark": "",
"ShareMark": false,
"App_Healthy_parameter": "",
"Filter_lbs_wifi": "",
"BatteryMaxVoltage": 0,
"BatteryMinVoltage": 0,
"Follow": 0
},
"GpsDatakey": {
"84381128040": {
"DeviceNo": "",
"Ltype": 0,
"Online": 0,
"Longitude": 0,
"Latitude": 0,
"Longitude1": 0,
"Latitude1": 0,
"Longitude2": 0,
"Latitude2": 0,
"N_S": "",
"E_W": "",
"Speed": 0,
"Direction": 0,
"Mode": "",
"DateTime": "0001-01-01T00:00:00Z",
"DateTime1": "",
"ReceiveTime": "0001-01-01T00:00:00Z",
"ReceiveTime1": "",
"Battery": -1,
"BatteryVoltage": 0,
"Oilquantity": 0,
"Acc": 0,
"Address": "",
"AddressUpdatetime": "0001-01-01T00:00:00Z",
"StayTime": 0,
"NextBootTime": "",
"Shefangchefang": 0,
"MainPower": 0,
"LbsData": null,
"WifiData": [],
"CustomData": ""
}
}
}
Json字段 | 含义 |
Result | 状态 |
Message | 消息名 |
DeviceNo | 设备编号 |
DeviceInfo | 设备信息结构见设备与分组数据章节中表一 |
GpsDatakey | 位置结构见gps缓存数据章节中表1 |
GPS轨迹数据
请求:
Get参数 | 含义 |
deviceno | 设备编号 |
startdate | 开始时间 |
enddate | 结束时间 |
SessionId | 会话ID |
响应:
{
"Result": "ok",
"Message": "",
"Deviceno": "84390730103",
"Startdate": "2021-06-30 18:23:48",
"Enddate": "2021-06-30 18:25:59",
"Playindex": 0,
"GpsDataArray": [
["2021-06-30 18:23:54", "117.29784", "32.53654", "117.30343", "32.53448", "117.31005", "32.54016", "67", "102", "-1", "0", "0", ""],
["2021-06-30 18:24:24", "117.30411", "32.53563", "117.30971", "32.53359", "117.31634", "32.53927", "75", "96", "-1", "0", "0", ""],
["2021-06-30 18:24:54", "117.31087", "32.53527", "117.3165", "32.53325", "117.32309", "32.53903", "76", "93", "-1", "0", "0", ""],
["2021-06-30 18:25:24", "117.31657", "32.53484", "117.3222", "32.53281", "117.32879", "32.5386", "52", "98", "-1", "0", "0", ""],
["2021-06-30 18:25:54", "117.31862", "32.53456", "117.32425", "32.53253", "117.33084", "32.53832", "24", "97", "-1", "0", "0", ""]
]
}
Json字段 | 含义 |
Result | 状态 |
Message | 消息名 |
Startdate | 开始时间 |
Enddate | 结束时间 |
Playindex | |
GpsDataArray | 轨迹点列表,点结构见表一 |
表一
索引 | 描述 |
0 | 位置时间 |
1 | Gps经度 |
2 | Gps纬度 |
3 | Gps经度(google) |
4 | Gps纬度(google) |
5 | Gps经度(baidu) |
6 | Gps纬度(baidu) |
7 | 速度 |
8 | 方向 |
9 | 电量 |
10 | Acc状态 |
11 | 基站定位标志 |
12 | 自定义数据 |
停留点数据
请求:
Get参数 | 含义 |
deviceno | 设备编号 |
startdate | 开始时间 |
enddate | 结束时间 |
SessionId | 会话ID |
响应:
{
"Result": "ok",
"Message": "",
"SelDeviceNo": "84390730103",
"Startdate": "2021-06-30 16:23:48",
"Enddate": "2021-06-30 20:25:59",
"Data": [{
"DeviceNo": "84390730103",
"Start_Longitude": 117.07687,
"Start_Latitude": 32.64736,
"Start_Longitude1": 117.08252,
"Start_Latitude1": 32.64547,
"Start_Longitude2": 117.08911,
"Start_Latitude2": 32.65125,
"Radius": 122.16,
"StartTime": "2021-06-30 15:03:32",
"StopTime": "2021-06-30 16:44:39",
"ResidenceTime": 6067,
"StayPointsAddress": null
}, {
"DeviceNo": "84390730103",
"Start_Longitude": 117.07618,
"Start_Latitude": 32.64855,
"Start_Longitude1": 117.08183,
"Start_Latitude1": 32.64666,
"Start_Longitude2": 117.08841,
"Start_Latitude2": 32.65244,
"Radius": 169.52,
"StartTime": "2021-06-30 16:44:49",
"StopTime": "2021-06-30 17:45:22",
"ResidenceTime": 3633,
"StayPointsAddress": null
}, {
"DeviceNo": "84390730103",
"Start_Longitude": 117.79919,
"Start_Latitude": 31.76009,
"Start_Longitude1": 117.80466,
"Start_Latitude1": 31.75806,
"Start_Longitude2": 117.81121,
"Start_Latitude2": 31.76383,
"Radius": 135.84,
"StartTime": "2021-06-30 19:49:46",
"StopTime": "2021-06-30 20:28:13",
"ResidenceTime": 2307,
"StayPointsAddress": null
}]
}
Json字段 | 含义 |
Result | 状态 |
Message | 消息名 |
SelDeviceNo | 设备编号 |
Startdate | 开始时间 |
Enddate | 结束时间 |
Data | 停留点列表,点结构见表一 |
表1
Json字段 | 含义 |
DeviceNo | 设备号 |
StartTime | 停留开始时间 |
StopTime | 停留结束时间 |
Start_Longitude | 停留点经度 |
Start_Latitude | 停留点纬度 |
Start_Longitude1 | 停留点经度(google) |
Start_Latitude1 | 停留点纬度(google) |
Start_Longitude2 | 停留点经度(baidu) |
Start_Latitude2 | 停留点纬度(baidu) |
Radius | 停留点半径 |
ResidenceTime | 停留时间,秒 |
StayPointsAddress | 停留点地址,客户端请求 |
Mqtt接口
一个账号下的设备,需要处于关注状态,后台才会转发位置和报警信息到账号对应的数据发布主题,第三方系统订阅这个主题后,可以实时接收到经由后台转发的设备实时位置和报警信息。
实时位置
消息结构
消息字段 | 含义 |
MsgType | 消息类型:gps |
DeviceNo | 设备号 |
Online | |
Acc | |
Mode | |
Longitude | Gps经度 |
Latitude | Gps纬度 |
Longitude1 | Gps经度(google) |
Latitude1 | Gps纬度(google) |
Longitude2 | Gps经度(baidu) |
Latitude2 | Gps纬度(baidu) |
N_S | S:南纬,N:北纬 |
E_W | E:东经,W:西经 |
Speed | 速度 |
Direction | 方向 |
DateTime1 | GPS时间 |
ReceiveTime1 | 信号时间 |
{
"MsgType": "gps",
"DeviceNo": "862607059076223",
"Online": 1,
"Acc": 0,
"Mode": "A",
"Latitude": 31.842539033333335,
"Longitude": 117.23089605,
"Latitude1": 31.840525033333336,
"Longitude1": 117.23637805,
"Latitude2": 31.846887333333335,
"Longitude2": 117.24280885,
"Speed": 0,
"Direction": 157.8,
"E_W": "E",
"N_S": "N",
"DateTime1": "2021-07-01 03:36:49",
"ReceiveTime1": "2021-07-01 03:36:49"
}
实时报警
消息结构
消息字段 | 含义 |
MsgType | 消息类型:Alarm |
DeviceNo | 设备号 |
Data | 报警信息,结构见GPS缓存数据章节 中表2 |
{
"MsgType": "Alarm",
"DeviceNo": "862607059076223",
"Data": {
"DeviceNo": "862607059076223",
"DeviceName": "陈工测试",
"AlarmType": 100,
"Longitude": 0,
"Latitude": 0,
"Longitude1": 0,
"Latitude1": 0,
"Longitude2": 0,
"Latitude2": 0,
"Speed": 0,
"Direction": 0,
"Mode": "",
"AlarmTime": "2021-07-01T02:44:06.411582188+08:00",
"AlarmTime1": "2021-07-01 02:44:06",
"GpsTime": "0001-01-01T00:00:00Z",
"GpsTime1": "",
"AlarmAddress": "",
"AlertInfo": "",
"OfflineTimeout": 0,
"FileName": "file/Media/20210701/862607059076223_00B7557EBA0B_20210630184405.jpg"
}
}
设备事件
消息结构
消息字段 | 含义 |
MsgType | 消息类型:HTTP_onEvent/Ftp_onEvent |
DeviceNo | 设备号 |
Data | 详细信息,结构见表1 |
表1
字段 | 含义 |
ChannelName | 通道名称 |
EventName | 事件名 File_Upload_Success:文件上传成功 File_Upload_Failure:文件上传失败 FTP_Upload_Success:ftp上传成功 FTP_Upload_Failure:ftp上传失败 |
FileName | 上传文件路径 |
MediaKey | 码流标识 |
Message | 附加消息 |
SerialNumber | 摄像机序列号 |
{
"MsgType": "HTTP_onEvent",
"DeviceNo": "862607059076223",
"Data": {
"ChannelName": "通道2",
"EventName": "File_Upload_Success",
"FileName": "file/Media/20210701/862607059076223_00B7557EBA0B_20210630184405.jpg",
"MediaKey": "SecondStreamProfileToken_640_352",
"Message": "",
"SerialNumber": "00B7557EBA0B"
}
}
消息结构
消息字段 | 含义 |
MsgType | 消息类型:Media_onEvent |
DeviceNo | 设备号 |
Data | 详细信息,结构见表1 |
表1
字段 | 含义 |
ChannelName | 通道名称 |
EventName | 事件名 Media_Screenshot_Success:截图成功 Media_Screenshot_Failure:截图失败 Media_VideoRecording_Success:视频录制成功 Media_VideoRecording_Failure:视频录制失败 |
FileName | |
MediaKey | 码流标识 |
Message | 附加消息 |
SerialNumber | 摄像机序列号 |
{
"MsgType": "Media_onEvent",
"DeviceNo": "862607059076223",
"Data": {
"ChannelName": "通道2",
"EventName": "Media_Screenshot_Success",
"FileName": "",
"MediaKey": "SecondStreamProfileToken_640_352",
"Message": "",
"SerialNumber": "00B7557EBA0B"
}
}