GAT1400视图库注册保活注销
注册、保活、注销
如果现场环境开启了注册认证机制,则需要关注本小节内容。
注册
视图库API的访问,需要进行身份验证,身份信息放在请求头部参数User-Identify,即一个新请求方的访问需要向视图库进行注册,注册成功后,才能进行后续操作。注册流程如下:

注意:在上面流程图中对接程序向视图库发起的两次请求中,请求体都应该为key为DeviceID,value为对应发起方系统的标识ID的JSON字符串,例:{“RegisterObject”:{“DeviceID”:”33010299011190000253″}},注册成功后,每次请求需添加请求头部参数User-Identify,值为DeviceID的value(33010299011190000253),详情参考接口注册。
保活
注册成功后,会有一定的有效期(一般为5分钟),在有效期内,如果没有接收到新的请求,注册信息将会失效,下次访问将需要重新注册;当然任何形式的成功请求,都能触发保活机制,重置有效期。
注销
当请求方无需和视图库进行通信时,可以请求注销接口,撤销注册消息。
注册
1.接口概览
URI | /VIID/System/Register | ||
方法 | 查询字符串 | 消息体 | 返回结果 |
POST | 无 | <Register> | <ResponseStatus> |
备注 |
2.消息体特征参数
3.返回结果
4.示例
URI | /VIID/System/Register |
请求方法 | POST |
请求头 | 参见请求参数 其他请求头参照注册流程图 |
请求体 | {“RegisterObject”:{“DeviceID”:”33010299011190000253″}} |
响应体 | { “ResponseStatusObject”: { “RequestURL”: “http://localhost:8080/VIID/Register”, “StatusCode”: 0, “StatusString”: “正常”, “Id”: “33010299011190000253”, “LocalTime”: “20171220204451” } } |
注销
1.接口概览
URI | /VIID/System/UnRegister | ||
方法 | 查询字符串 | 消息体 | 返回结果 |
POST | 无 | <Register> | <ResponseStatus> |
备注 |
2.消息体特征参数
3.返回结果
4.示例
URI | /VIID/System/UnRegister |
请求方法 | POST |
请求头 | 参见请求参数 |
请求体 | {“DeviceID”:”33010299011190000253″} |
响应体 | { “ResponseStatusObject”: [ { “RequestURL”: “http://localhost:8080/VIID/UnRegister”, “StatusCode”: 0, “StatusString”: “正常”, “Id”: “33010299011190000253”, “LocalTime”: “20171220204451” } ] } |
保活
1.接口概览
URI | /VIID/System/Keepalive | ||
方法 | 查询字符串 | 消息体 | 返回结果 |
POST | 无 | < Keepalive > | <ResponseStatus> |
备注 |
2.消息体特征参数
3.返回结果
4.示例
URI | /VIID/System/Keepalive |
请求方法 | POST |
请求头 | 参见请求参数 |
请求体 | {“DeviceID”:”33010299011190000253″} |
响应体 | { “ResponseStatusObject”: [ { “RequestURL”: “http://localhost:8080/VIID/Keepalive”, “StatusCode”: 0, “StatusString”: “正常”, “Id”: “33010299011190000253”, “LocalTime”: “20171220204451” } ] } |
C.25 应答状态对象
//应答状态对象
<complexType name=”ResponseStatus”>
<sequence>
<element name=”RequestURL” type=”string ” use=”required”/>
<element name=”StatusCode” type=” int” use=”required”/>
<element name=”StatusString” type=”string” />
<element name=”Id” type=”string” minOccurs=”0″ maxOccurs=”1″/>
<element name=”LocalTime” type=”dateTime” minOccurs=”0″ maxOccurs=”1″/>
</sequence>
</ complexType>
//应答状态对象列表
<complexType name=”ResponseStatusList”>
<sequence>
<element name=”ResponseStatusObject” type=”ResponseStatus” minOccurs=”1″ />
</sequence>
</complexType>
C.26 注册对象
//注册对象
<complexType name=”Register”>
<sequence>
<element name=”DeviceID” type=”DeviceIDType” use=”required”/>
</sequence>
</ complexType>
C.27 保活对象
//保活对象
<complexType name=”Keepalive”>
<sequence>
<element name=”DeviceID” type=”DeviceIDType” use=”required”/>
</sequence>
</complexType>
C.28 注销对象
//注销对象
<complexType name=”UnRegister “>
<sequence>
<element name=”DeviceID” type=”DeviceIDType” use=”required”/>
</sequence>
</ complexType>