EXLIVE平台接口规范(JSON)

本规范规定了接入EXLIVE平台的接口定义,采用TCP通讯方式,实现了用户登录、权限验证、各种数据传输等功能。

本规范主要用来实现第三方软件和EXLIVE平台互通

采用TCP传输方式,端口为1502

数据格式使用json格式

  • 第三方平台数据接入exlive平台步骤
  •  >> 获取一个exlive 平台帐号
  •  >> 以TCP方式登录exlive平台1502端口,参考用户登录命令1000
  •  >> 等待exlive平台登录返回成功,如果返回结果不是success服务器将掐断TCP连接
  •  >> 收到成功后,第三方平台需要间隔30秒发送心跳消息,参看客户端心跳 1002
  •  >> 连接成功后,第三方平台可以按照 车辆定位数据 1007 格式上传车辆数据
  •  >> 第三方平台退出连接可以发送 用户退出 1001命令,然后断开TCP连接

 

1.用户登录  client->server

{"header":{"cmd":"1000"},"body":{"name":"exlive","pass":"000000","ver":"","type":"","mode":""}}

 

2.命令应答   server->client

{"header":{"cmd":"8000"},"body":{"cmd":"1000","result":"success" }}

 

3.用户退出,注销登录  client->server
{"header":{"cmd":"1001"},"body":{"data":""}

 

4.客户端心跳   client->server
{"header":{"cmd":"1002"},"body":{"result":"" }}

5.发送消息   client <-> server
{"header":{"cmd":"1003"},"body":{"msg":"" }}

 

6.车机命令 client->server

{"header":{"cmd":"1004"},"body":{"id":"","data":"" }}

 

7.用户所述客户分组信息 client->server

{"header":{"cmd":"1005"},"body":{"data":"" }}

 

8.用户下发的车辆数据 client->server

{"header":{"cmd":"1006"},"body":{"data":"" }}

 

9.服务器向客户端下发车辆定位数据server -> client

{"header":{"cmd":"1007"},"body":{"code":"","id":"","lat":"","lng":"","veo":"","dir":"","gpstime":"","av":"","alarm":"","oil":"","dis":"","wstate":"","cstate":"","posinfo":"" }}

gpstime格式: 2011-11-01 12:38:39

Av表示是否为有效定位 0 无效定位 1有效定位

Cstate为状态描述,可以为空

posinfo为位置描述,可以为空

Alarm: 是否报警 0 无报警 1 报警

Oil: 当前油量

Dis: 当前总里程

 

10.请求下发用户权限下客户及分组数据 client->server

{"header":{"cmd":"1008"},"body":{"client":"true" }}

Client: true   下发客户关系数据 false 不下发

 

11. 用户的分组权限数据 server->client 

{"header":{"cmd":"1009"},"body":{"groupid":"","relation":"","customer":"","goupname":"" }}

 

12.请求服务器下发用户权限下分组车辆数据 client->server

{"header":{"cmd":"1010"},"body":{"groupid":"1" }}

 

13.服务器下发用户权限下分组车辆数据 server->client

{"header":{"cmd":"1011"},"body":{"id":"","code":"","sim":"" }}

 

14.发送车机透传命令到设备 client->server

{"header":{"cmd":"1012"},"body":{"terminalid":"","code":"","data":"" }}

 

15.转发设备透传数据到客户端 server->client

{"header":{"cmd":"1013"},"body":{"terminalid":"","code":"","data":"" }