HATC Open API Developer Manual-V1.2.3
HATC Open API Developer Manual-V1.2.3
Developer Guide
HAT Cloud Open API Developer Guide
Contents
Chapter 1 Introduction........................................................................................................ 1
1.1 Glossary ................................................................................................................. 1
Chapter 2 Basic Explanation................................................................................................ 2
2.1 Description of HTTPS interface request signature generation method ............... 2
2.2 API service endpoint ............................................................................................. 6
2.3 Basic process ......................................................................................................... 6
Chapter 3 Manage Devices ................................................................................................. 8
3.1 List device protocols and product key .................................................................. 8
3.2 Add devices ........................................................................................................... 9
3.3 Edit devices ......................................................................................................... 11
3.4 Delete devices ..................................................................................................... 12
3.5 List devices .......................................................................................................... 13
3.6 Query the online status of devices ..................................................................... 16
3.7 Convert device serial number ............................................................................. 17
3.8 Disable devices .................................................................................................... 18
3.9 Enable devices ..................................................................................................... 19
Chapter 4 Device Data ...................................................................................................... 21
4.1 Query GPS List ..................................................................................................... 21
4.2 Query the latest GPS information ....................................................................... 24
4.3 List alarm ............................................................................................................. 25
4.4 Query device alarm attachments........................................................................ 31
4.5 Get file download link ......................................................................................... 32
4.6 Synchronize facial information ........................................................................... 33
4.7 Distribute facial change information .................................................................. 36
4.8 Confirm emergency alarm .................................................................................. 37
4.9 Set speed threshold ............................................................................................ 38
4.10 Query the daily flow of the device .................................................................... 39
i
HAT Cloud Open API Developer Guide
ii
HAT Cloud Open API Developer Guide
iii
HAT Cloud Open API Developer Guide
Chapter 1 Introduction
The HAT Cloud Open API service provides developers with HTTPS interfaces, which allows developers
to initiate retrieval requests through HTTPS and obtain returned JSON data. Users can develop
applications in languages such as JavaScript, C #, C++, Java, etc. based on this.
1.1 Glossary
Term Description
HAT Cloud HikAuto Technology Cloud platform
AccessKey apply for AppKey from HAT Cloud platform. Contact the marketing or
sales personnel to obtain it.
AccessSecret apply for AccessSecret from HAT Cloud platform. Contact the
marketing or sales personnel to obtain it.
ProductKey Product key. The code automatically assigned when the account is
generated. Devices with the same account and protocol type have the
same ProductKey.
serialNumber Hikvision device tag serial number
terminalID/deviceCode/ Device terminal number. The unique identification of the device in
phoneNumber HAT Cloud platform. The phone number used when the device is
connected to the platform, generally an 11-digit number, not
exceeding 12 digits. The terminalID and deviceCode mentioned in this
document both represent this data.
Device sleep The device is in a low power state
Alarm attachment The alarm attachment is the photo or video reported by the device
after it reports an alarm. It is usually used as evidence or proof for the
alarm. Download it from the file link.
1
HAT Cloud Open API Developer Guide
2
HAT Cloud Open API Developer Guide
System Parameters
[Link]("SignatureMethod", "HMAC-SHA1");
[Link]("SignatureNonce", [Link]().toString());
[Link]("AccessKey", accessKey);
[Link]("Version", "2.1.0");
[Link]("Timestamp", timeStamp);
[Link]("RegionId", "cn-hangzhou");
Business Parameters
Develop according to each interface as appropriate
Remove signature key
if ([Link]("Signature"))
[Link]("Signature");
Step 2: Sort by parameter Key (order)
The Java reference code is as follows:
3
HAT Cloud Open API Developer Guide
There are two steps to construct the request string to be signed. Step 1 is to concatenate the sorted
parameters into the following format:
specialUrlEncode(parameterKey) + "=" + specialUrlEncode(parameterValue)
4
HAT Cloud Open API Developer Guide
Concatenate the final string to be signed according to the signature rules of POP, as follows:
HTTPMethod + "&" + specialUrlEncode("/") + "&" + specialUrlEncode(sortedQueryString)
The Java reference code is as follows:
StringBuilder stringToSign = new StringBuilder();
[Link]("GET").append("&");
[Link](specialUrlEncode("/")).append("&");
[Link](specialUrlEncode(sortedQueryString));
Note
Before signing, it is necessary to check if the stringToSign still contains characters that have not
been URL encoded, including (+), (*), (,), (/), etc. Please refer to the Appendix for the URL encoding
table.
● Step 4: Sign
Signature using HmacSHA1 algorithm + Base64. Encoding using UTF-8. The Java reference code is as
follows:
String sign = sign(accessSecret + "&", [Link]());
public static String sign(String accessSecret, String stringToSign) throws Exception {
[Link] mac = [Link]("HmacSHA1");
[Link](new [Link]([Link]("UTF-8"), "HmacSHA1"));
byte[] signData = [Link]([Link]("UTF-8"));
return new [Link].BASE64Encoder().encode(signData);
}
Parameter description:
accessSecret:Your accessSecret corresponds to the accessKey. Special note: POP requires an additional "&" cha
racter to be added after the key, which is accessSecret + "&"
stringToSign:The request string to be signed generated in the third step
● Step 5: Add the signature result to the request parameters and send the
request
Attention: Special URL encoding is also required for the signature
5
HAT Cloud Open API Developer Guide
Note
After signing, it is necessary to check if the Signature still contains characters that have not been
URL encoded, including (+), (*), (,), (/), etc. Please refer to the Appendix for the URL encoding
table.
6
HAT Cloud Open API Developer Guide
7
HAT Cloud Open API Developer Guide
8
HAT Cloud Open API Developer Guide
]
}
● URI
POST /device/add
● Request Parameters
Parameter Description Class Default Required
deviceList JSON format array, the format of a single JSON List<Object> - Y
object is shown in Table 3-1
9
HAT Cloud Open API Developer Guide
10
HAT Cloud Open API Developer Guide
1f37c23d6a5b&Timestamp=1755326718167&Version=2.1.0&deviceList=%5B%7B%22timeZone%22%
3A-
3%2C%22language%22%3A%22EN%22%2C%22terminalID%22%3A%2212345678910%22%2C%22devi
ceChannelList%22%3A%5B%7B%22channelName%22%3A%22ch1%22%2C%22channelType%22%3A0
%2C%22channelNum%22%3A1%7D%5D%2C%22productKey%22%3A%22808_D_SUB_test_17345305
50607%22%7D%2C%7B%22timeZone%22%3A-
3%2C%22language%22%3A%22EN%22%2C%22terminalID%22%3A%2223456789101%22%2C%22pro
ductKey%22%3A%22808_D_SUB_test_1734530550607%22%7D%5D
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data. The data type in the returned data is Map. Key is Map<String,String>
the number of the terminal where the device was added. Value
is the addition result, and when successful, it is “succeed”
● Response Example
{
"status": 0,
"data": {
"13211111111": "succeed",
"13211111112": "succeed"
}
}
11
HAT Cloud Open API Developer Guide
● Request Parameters
Parameter Description Class Default Required
deviceList JSON format array, the format of a single JSON List<Object> - Y
object is shown in Table 3-3
● Escaped parameters
Signature=QsFpU739WdpIokULWuQY7EdTkLM%3D&AccessKey=D_SUB_test_1734530550607&Regio
nId=cn-hangzhou&SignatureMethod=HMAC-SHA1&SignatureNonce=e1cd065c-8b2b-4b53-9efe-
3ba93a0c7810&Timestamp=1753428598745&Version=2.1.0&deviceList=%5B%7B%22terminalID%22
%3A%2212345678910%22%2C%22deviceChannelList%22%3A%5B%7B%22channelName%22%3A%22
ch1%22%2C%22channelType%22%3A0%2C%22channelNum%22%3A1%7D%5D%2C%22productKey%
22%3A%22808_D_SUB_test_1734530550607%22%7D%5D
● Response
Same as adding devices interface.
12
HAT Cloud Open API Developer Guide
13
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data, pagination object Object
[Link] Total number of pages Integer
[Link] Current page number Integer
[Link] Total number of records Long
[Link] Record start number Long
[Link] The data type is List. The detailed field description of the List<Object>
Object is shown in Table 3-4
14
HAT Cloud Open API Developer Guide
"status": 0,
"data": {
"results": [
{
"terminalID": "13100000001",
"productKey": " 808_D_SUB_test_1730441301885 ",
"version": "V23.10.10",
"createTime": "2022-02-24 [Link]",
"deviceStatus": 0,
"language": "CN",
"deviceChannelList": [
{
"channelName": "channel1",
"channelNum": 1,
"channelType": 0
}
],
"plateNum": "AD2228",
"organizeId": 17,
"organizeName": "organize1",
"timeZone": -3
},
{
"terminalID": "13100000000",
"productKey": "808_2013_vwqFtSVp",
"version": "",
"createTime": "2022-02-22 [Link]",
"deviceStatus": 0,
"language": "CN",
"deviceChannelList": [
{
"channelName": "channel1",
"channelNum": 1,
"channelType": 0
15
HAT Cloud Open API Developer Guide
},
{
"channelName": "channel2",
"channelNum": 2,
"channelType": 0
}
],
"plateNum": "A8221",
"organizeId": 19,
"organizeName": "organize2",
"timeZone": -3
}
],
"totalPages": 1,
"currentPage": 1,
"totalRecords": 2,
"startIndex": 0
}
}
16
HAT Cloud Open API Developer Guide
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data. The data type in the returned data is Map. Key Map<String,Integer>
is the number of the terminal where the device was added.
Value is the online status -1: No permission for this device(Not
belong to you) 0: Offline; 1: Online; 2: Sleep
● Response Example
{
"status": 0,
"data": {
"13211111111": 0,
"13211111112": 1
}
}
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
17
HAT Cloud Open API Developer Guide
msg Error message description, only has a value when the status is not String
0
data 11 digit terminal number String
● Response Example
{
"status": 0,
"data": "13764829845"
}
18
HAT Cloud Open API Developer Guide
{
"status": 0,
"data": {
"13211111111": "succeed",
"13211111112": "succeed"
}
}
19
HAT Cloud Open API Developer Guide
"data": {
"13211111111": "succeed",
"13211111112": "succeed"
}
}
20
HAT Cloud Open API Developer Guide
21
HAT Cloud Open API Developer Guide
aac2bfdbb181&Timestamp=1753428355673&Version=2.1.0&deviceCode=12345678910&endTime=yy
yy-MM-dd%20HH%3Amm%3Ass&startTime=yyyy-MM-dd%20HH%3Amm%3Ass
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data, pagination object Object
[Link] Total number of pages Integer
[Link] Current page number Integer
[Link] Total number of records Long
[Link] Record start number Long
[Link] The data type is List. The detailed field description of the List<Object>
Object is shown in Table 4-1
22
HAT Cloud Open API Developer Guide
createTime The platform received GPS time in the UTC+0 time zone, yyyy-MM-dd String
HH:mm:ss
● Response Example
{
"status": 0,
"data": {
"results": [
{
"gpsValid": 1,
"longitude": 120.323123,
"latitude": 30.251523,
"altitude": 3.0,
"speed": 7.6,
"direction": 108,
"collectTime": "2022-03-07 [Link]",
"accStatus": "1",
"supplementSign": 0,
"createTime": "2022-03-07 [Link]"
},
{
"gpsValid": 1,
"longitude": 120.323623,
"latitude": 30.252023,
"altitude": 3.0,
"speed": 8.0,
"direction": 10,
"collectTime": "2022-03-07 [Link]",
"accStatus": "1",
"supplementSign": 0,
"createTime": "2022-03-07 [Link]"
}
],
"totalPages": 1,
23
HAT Cloud Open API Developer Guide
"currentPage": 1,
"totalRecords": 2,
"startIndex": 0
}
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data, detailed object data can be found in Table 4-1 Object
● Response Example
24
HAT Cloud Open API Developer Guide
{
"status": 0,
"data": {
"gpsValid": 1,
"longitude": 120.457708,
"latitude": 30.420116,
"altitude": 3.0,
"speed": 9.7,
"direction": 327,
"collectTime": "2022-03-07 [Link]",
"accStatus": "1",
"supplementSign": 0
}
}
25
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data, pagination object Object
[Link] Total number of pages Integer
[Link] Current page number Integer
[Link] Total number of records Long
[Link] Record start number Long
[Link] The data type is List. The detailed field description of the List<Object>
Object is shown in Table 4-2 (Note: Different alarm data
objects may contain different fields)
26
HAT Cloud Open API Developer Guide
27
HAT Cloud Open API Developer Guide
28
HAT Cloud Open API Developer Guide
● Response Example
● Note
● Different alarm types return different data, and the specific return value needs to be
obtained according to the actual alarm type.
●
{
"status": 0,
"data": {
"results": [
{
"deviceCode": "19955883917",
29
HAT Cloud Open API Developer Guide
"productKey": "808_2013_vwqFtSVp",
"type": -30,
"state": 0,
"subType": 0,
"time": "2022-03-07 [Link]",
"gpsValid": 1,
"alarmSign": "19955883917-220307142355-0-0",
"serializeState": false,
"needAttachUpload": false,
"attachFlag": false,
"discard": false
},
{
"deviceCode": "19955883917",
"productKey": "808_2013_vwqFtSVp",
"type": -30,
"state": 0,
"subType": 0,
"time": "2022-03-07 [Link]",
"gpsValid": 1,
"alarmSign": "19955883917-220307144916-0-0",
"serializeState": false,
"needAttachUpload": false,
"attachFlag": false,
"discard": false
}
],
"totalPages": 1,
"currentPage": 1,
"totalRecords": 2,
"startIndex": 0
}
}
30
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix Integer
return status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data, the list of alarm attach info, see in Table 4-6 List<Object>
● Response Example
{
"status": 0,
"data": {
31
HAT Cloud Open API Developer Guide
"results": [
{
"fileName": "[Link]",
"fileSize": 1424213123,
"type": 0,
"url": "[Link]"
}
],
"totalPages": 1,
"currentPage": 1,
"totalRecords": 1,
"startIndex": 0
}
}
32
HAT Cloud Open API Developer Guide
33
HAT Cloud Open API Developer Guide
Synchronize the driver/passenger facial information corresponding to the device to the cloud.
If you want to send a face to the device, you can first call the “/face/sync” interface to synchronize
the face to the cloud, and then call “/face/change” interface to send the face to the device.
Then subscribe message type “EVENT” by the webhook, when “type” is -30 and “subType” is 10, it
represents the event of facial comparison results. Data includes “faceRecognitionData”(the analysis
results of facial comparison). For the detail field of each message type, refer to Appendix-Subscription
Message Data Fields
34
HAT Cloud Open API Developer Guide
35
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
36
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
37
HAT Cloud Open API Developer Guide
After an emergency alarm occurs, manually confirm it. Used to end an emergency alarm. If not
confirmed, this emergency alarm will remain in a continuous state.
The emergency alarm of this interface only refers to the emergency alarm with type -32 and
subtype 0.
● URI
GET /alarm/confirmEmergency
● Request Parameters
Parameter Description Class Default Required
terminalID Device terminal number, not exceeding 12 digits String - Y
productKey Product key String - Y
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
38
HAT Cloud Open API Developer Guide
● Response Example
{
"status": 0
}
39
HAT Cloud Open API Developer Guide
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status String
is not 0
data Response data, the list of Device Flow Data, see in Table 4-8 List<Object>
● Response Example
{
"status": 0,
"data": [
{
"date":"2025-08-01",
"flow":1892
}
]
40
HAT Cloud Open API Developer Guide
● Response Example
{
"status": 0,
"data": [
{
"date":"2025-08",
"flow":289121
}
]
}
41
HAT Cloud Open API Developer Guide
42
HAT Cloud Open API Developer Guide
● Response Example
{
"status": 0,
"data": [
{
"fileName":" 16065911991_1_2_20250818050112.jpg",
"url":"[Link] ?expire",
"fileSize": 7803
}
]
}
43
HAT Cloud Open API Developer Guide
Regarding how to use and play the URL, please refer to demo and documentation of Media.
● URI
GET /device/preview
● Request Parameters
44
HAT Cloud Open API Developer Guide
● URI
GET /device/previewBatchChannel
● Request Parameters
Parameter Description Class Default Required
45
HAT Cloud Open API Developer Guide
46
HAT Cloud Open API Developer Guide
GET /device/videoList
● Request Parameters
Parameter Description Class Default Required
deviceCode Device terminal number, not exceeding 12 digits String - Y
startTime Start Time in the device's time zone, yyyy-MM-dd String - Y
HH:mm:ss
endTime End Time in the device's time zone , yyyy-MM-dd String - Y
HH:mm:ss
channelNo Channel number, start from 1 Integer 1 N
streamType Stream type, 0 main stream, 1 sub stream, default to 1 Integer 1 N
storeType Memory type, 0: All 1: Main memory; 2: Disaster Integer 1 N
Recovery Memory
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data Response data, pagination object Object
[Link] Total number of pages Integer
[Link] Current page number Integer
[Link] Total number of records Long
[Link] Record start number Long
[Link] The data type is List. The detailed field description of the List<Object>
Object is shown in Table 5-1
47
HAT Cloud Open API Developer Guide
{
"status": 0,
"data": [
{
"channelNo": 1,
"startTime": "2022-03-07 [Link]",
"endTime": "2022-03-07 [Link]",
"mediaType": 2,
"streamType": 1,
"storeType": 1,
"fileSize": 29350172,
"eventCode": 0
},
{
"channelNo": 1,
"startTime": "2022-03-07 [Link]",
"endTime": "2022-03-07 [Link]",
"mediaType": 2,
"streamType": 1,
"storeType": 1,
"fileSize": 75335956,
"eventCode": 0
}
]
}
48
HAT Cloud Open API Developer Guide
5.4 Playback
● Introduction to Interface Functions
Obtain the URL for video playback. The URL is valid for 60 seconds and can only be used once.
Regarding how to use and play the URL, please refer to demo and documentation of Media.
● URI
GET /device/videoReplay
● Request Parameters
Parameter Description Class Default Required
deviceCode Device terminal number, not exceeding 12 digits String - Y
startTime Start Time in the device's time zone, yyyy-MM-dd String - Y
HH:mm:ss
endTime End Time in the device's time zone, yyyy-MM-dd String - Y
HH:mm:ss
channelNo Channel number, start from 1 Integer 1 N
streamType Stream type, 0 main stream, 1 sub stream, default Integer 1 N
to 1
storeType Memory type, 0: All 1: Main memory; 2: Disaster Integer 1 N
Recovery Memory
streamProtocol Video streaming protocol type,0 RTSP,2 HLS,3 Integer 0 N
WEBSOCKET, 4 Http-Flv
Note
HLS: Playback speed doubling and other controls are not supported.
Http-Flv: The extended playback control command is required
● Response
Parameter Description Class
49
HAT Cloud Open API Developer Guide
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Video stream URL String
● Response Example
{
"status": 0,
"data": "rtsp://211.***.***.***:10650/JT808_11177777777_1_0_uuid=75D34D40-6F8B-EC45-
9AC8-C5ECC2400D4_playMode=0"
}
● URI
GET /device/videoReplayBatchChannel
● Request Parameters
Parameter Description Class Default Required
deviceCode Device terminal number, not exceeding 12 String - Y
digits
startTime Start Time in the device's time zone, yyyy- String - Y
MM-dd HH:mm:ss
endTime End Time in the device's time zone, yyyy-MM- String - Y
dd HH:mm:ss
channelNoList List of channel numbers, start from 1 List<Integer> - Y
streamType Stream type, 0 main stream, 1 sub stream, Integer 1 N
default to 1
storeType Memory type, 0: All 1: Main memory; 2: Integer 1 N
Disaster Recovery Memory
50
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is String
not 0
data The data type in the returned data is Map. Key is the channel Map<Integer,String>
number. Value is the video stream URL
● Response Example
{
"status": 0,
"data": {
"1":"rtsp://211.***.***.***:10650/JT808_11177777777_1_0_uuid=75D34D40-6F8B-EC45-9AC8-
C5ECC2400D4_playMode=0",
"2":"rtsp://211.***.***.***:10650/JT808_11177777777_2_0_uuid=24D34D40-6F8B-EC45-9AC8-
C5ECC2400G1_playMode=0"
}
}
51
HAT Cloud Open API Developer Guide
GET /device/intercom
● Request Parameters
Parameter Description Class Default Required
deviceCode Device terminal number, not exceeding 12 digits String - Y
channelNo Channel number, start from 1 Integer - Y
intercomMode 0- Real time intercom 1 v 1 , 3- Monitoring, 5- Integer 1 N
Broadcasting
inviter The inviter of the intercom, that is, the username of String - N
the calling interface
groupNo Group number (only used when joining an existing String - N
broadcast group, not filled in by default, generated
by the server)
protocol Intercom protocol, 0-private protocol, 1-websocket Integer 0 N
sslOn Only valid when using websocket. 0-ws protocol, 1- Integer 1 N
wss protocol
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data The data type is Object, see details in Table 5-4 Object
52
HAT Cloud Open API Developer Guide
53
HAT Cloud Open API Developer Guide
Note
If the third flag bit of the TTS broadcast read terminal is 1, then binary representation is 1000,
converted to decimal representation is 8, and the type parameter is filled with 8
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
54
HAT Cloud Open API Developer Guide
● URI
GET /download/create
● Request Parameters
Parameter Description Class Default Required Notes
terminalID Device terminal number, not exceeding String - Y
12 digits
productKey Product key String - Y
channelNo Channel number, cannot be 0, start from Integer - Y
1
startTime Start Time in the device's time zone, String - Y
yyyy-MM-dd HH:mm:ss
endTime End Time in the device's time zone, yyyy- String - Y
MM-dd HH:mm:ss
storeType Memory type, 0: All 1: Main memory; 2: Integer 1 N
Disaster Recovery Memory
mediaType Video and audio type, 0: audio and Integer 2 N
video; 1: Audio; 2: Video
streamType Stream type, 0 main stream, 1 sub Integer 1 N
stream, default to 1
eventCode Event Code Long 0 N
55
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
data download task id String
● Response Example
{
"status": 0,
"data": "upload_20254645851"
}
56
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer Integer
to the appendix return status code table for other
values.
msg Error message description, only has a value when the String
status is not 0
data The data type in the returned data is Map. Key is the Map<Integer,String>
channel number. Value is the download task id
● Response Example
{
"status": 0,
"data": {
"1":"upload_20254645851",
"2":"upload_20254645935"
}
}
57
HAT Cloud Open API Developer Guide
● URI
DELETE /download/delete
● Request Parameters
Parameter Description Class Default Required Notes
taskId download task id String - Y
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
58
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
data The data type is Object, see details in Table 5-6 Object
59
HAT Cloud Open API Developer Guide
● Response Example
{
"status": 0,
"data": {
"downloadStatus": 0,
"downloadUrlList": ["[Link]
"channelNo":1,
"storeType":0,
"startTime": "2022-03-07 [Link]",
"endTime": "2022-03-07 [Link]",
"mediaType":2,
"streamType":0
}
}
60
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
data The data type in the returned data is Map. Key is the task id. Object
Value is Object, see details in Table 5-6
● Response Example
{
"status": 0,
"data": {"upload_20254645851":{
"downloadStatus": 0,
"downloadUrlList": ["[Link]
"channelNo":1,
"storeType":0,
"startTime": "2022-03-07 [Link]",
"endTime": "2022-03-07 [Link]",
"mediaType":2,
61
HAT Cloud Open API Developer Guide
"streamType":0
},
"upload_20254645935":{
"downloadStatus": 0,
"downloadUrlList": ["[Link]
"channelNo":1,
"storeType":0,
"startTime": "2022-03-07 [Link]",
"endTime": "2022-03-07 [Link]",
"mediaType":2,
"streamType":0
}
}
}
62
HAT Cloud Open API Developer Guide
● Request Header
Field Description Default Notes
63
HAT Cloud Open API Developer Guide
X-Hikauto- signature of the - the customer verifies the signature after receiving
Signature message body the message, in order to ensure the message’s
origin. See the following Sample Codes for details.
● Request Body
Parameter Description Class Notes
messageType Message type String Consistent with the message type in the message
subscription, for example: EVENT(alarm message),
GPS(gps data message), etc.
content Message data in String For the detail field of each message type, refer to
JSON format Appendix-Subscription Message Data Fields
● Callback Address receiving template (JAVA)
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
@RequestMapping("/webhook")
@RestController
public class ReceiveController {
64
HAT Cloud Open API Developer Guide
accessSecret").hmacHex(content);
if () {
[Link]("signature error.");
return new ResponseEntity(HttpStatus.BAD_REQUEST);
}
//todo: Process the received message.
// It is better to send it to other middleware or write it to the database,
// without affecting the processing of the callback address
String messageType = [Link]("messageType");
JSONObject jsonObject = [Link](content);
//Process the received message.
● Response
For a webhook push, if the http return code of the customer webhook service is 200, the push is
successful.
65
HAT Cloud Open API Developer Guide
● Request Parameters
Defa Requi
Parameter Description Class Notes
ult red
messageTypeList Consistent with the message List<String> - Y For the full
type in the message list, please
subscription, for example: refer to
EVENT(alarm message), Message Type
GPS(gps data message), etc. Consistent
productKeyList Product key List<String> - Y
callbackUrl Full URL of the webhook String Y Multi-types
address, usually in the format of data will be
http(s)://hostname[:port]/path. pushed to the
The interface will verify same address
whether it can connect to this
address. If it cannot connect,
the subscription will fail.
● Message Type Consistent
Message Type Name Consistent
Gps Data GPS
Alarm message EVENT
Device Online/Offline DEVICE_STATE
Alarm attach UPLOAD_FILE_COMPLETE
● Parameter display
Signature=LlxZ1x47qHlBnS0id8jvMZjOBRs=&AccessKey=D_SUB_test_1734530550607&RegionId=cn-
hangzhou&SignatureMethod=HMAC-SHA1&SignatureNonce=b1464c58-548e-430e-80ff-
851dd80709cc&Timestamp=1753428072022&Version=2.1.0&callbackUrl=[Link]
ook/receiveData&messageTypeList=["DEVICE_STATE","GPS","EVENT"]&productKeyList=["808_D_SUB
_est_1734530550607"]
● Escaped parameters
Signature=LlxZ1x47qHlBnS0id8jvMZjOBRs%3D&AccessKey=D_SUB_test_1734530550607&RegionId=c
n-hangzhou&SignatureMethod=HMAC-SHA1&SignatureNonce=b1464c58-548e-430e-80ff-
851dd80709cc&Timestamp=1753428072022&Version=2.1.0&callbackUrl=https%3A%2F%2F1.1.1.1%3
66
HAT Cloud Open API Developer Guide
A4170%2Fwebhook%2FreceiveData&messageTypeList=%5B%22DEVICE_STATE%22%2C%22GPS%22%
2C%22EVENT%22%5D&productKeyList=%5B%22808_D_SUB_test_1734530550607%22%5D
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
Note
If you want to obtain alarm attachments, subscribe to UPLOAD_FILE_COMPLETE. Use the
“fileName” field from the response data to call the interface “media/download/” to obtain the file
download address.
67
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
● Response Example
{
"status": 0
}
68
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class Notes
status Request result status value, success is 0. Please refer to the Integer
appendix return status code table for other values.
msg Error message description, only has a value when the status is not String
0
data Subscription detail Object
● Response Example
{
"status": 0,
"data": [
{
"developAccount": "D_SUB_demo_123456789",
"webhookMessageTypes": [
"GPS"
]
69
HAT Cloud Open API Developer Guide
}
]
}
70
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data Object
● Response Example
{
"status": 0,
"data": [
{
"code": "01",
"name": "comm model"
}
]
}
71
HAT Cloud Open API Developer Guide
72
HAT Cloud Open API Developer Guide
● URI
POST /maintenance/upgrade/file/delete
● Request Parameters
Parameter Description Class Default Required
upgradeFileIds List of upgrade file record id List<Long> - Y
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
73
HAT Cloud Open API Developer Guide
74
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data Object
● Response Example
{
"status": 0,
"data": {
"upgradeTaskId": 1
}
}
75
HAT Cloud Open API Developer Guide
● URI
POST /maintenance/upgrade/tasks/datail
● Request Parameters
Parameter Description Class Default Required
upgradeTaskId upgrade task id Long - Y
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data Object
● Response Example
{
"status": 0,
"data": {
"upgradeTaskId": 1,
"deviceModel": "AE-VT7108B-GJ",
"firmwareVersion": "V4.4.1 build240523",
"deviceList": [
{
"createTime": "1739954727000",
"deviceCode": "1*********6",
"deviceModel": "AE-MD5043-SD",
"deviceSerialNum": "K********3",
"originalVersion": "V5.9.0 build250218",
"currentVersion": "V5.9.0 build250219",
"sendCmdTime": 1739954730000,
/**
* upgrade state
* 1=Command not issued;
* 2=Command has been issued;
76
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
77
HAT Cloud Open API Developer Guide
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
78
HAT Cloud Open API Developer Guide
● Request Parameters
Parameter Description Class Default Required
upgradeTaskId upgrade taskId id Long - Y
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
79
HAT Cloud Open API Developer Guide
● Response Example
{
"status": 0
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response datareturn data . see Device Parameter Protocol [Link] . Object
● Response Example
{
"status": 0,
"data":
"{\"IsApiSpeedingOthers\":{\"subStatusCode\":\"\",\"statusString\":\"\",\"overSpeedAlarmWarningV
alue\":100,\"overSpeedDurationTime\":30,\"maxSpeed\":100,\"platformId\":0,\"type\":1,\"channelId
\":\"\",\"url\":\"/JT808/0/0x8106\",\"statusCode\":\"\"}}"
80
HAT Cloud Open API Developer Guide
81
HAT Cloud Open API Developer Guide
"data": {
"configTaskId": 1
}
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
data Response data Object
● Response Example
{
"status": 0,
"data": {
"configTaskId": 1,
"deviceList": [
{
"createTime": "1739954727000",
"deviceCode": "15957281606",
"deviceModel": "AE-MD5043-SD",
82
HAT Cloud Open API Developer Guide
"deviceSerialNum": "K85250293",
/**
* config state
* 0=Command not issued;
* 1=Config Successful;
* 2=Config failed;
*/
"configState": 1,
"configStateTime": 1739954834000,
"failReason": ""
}
]
}
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
83
HAT Cloud Open API Developer Guide
{
"status": 0
}
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
84
HAT Cloud Open API Developer Guide
● URI
POST /maintenance/config/tasks/retryAll
● Request Parameters
Parameter Description Class Default Required
configTaskId configuration taskId id Long - Y
● Response
Parameter Description Class
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
● Response
Parameter Description Class
85
HAT Cloud Open API Developer Guide
status Request result status value, success is 0. Please refer to the appendix return Integer
status code table for other values.
msg Error message description, only has a value when the status is not 0 String
● Response Example
{
"status": 0
}
86
HAT Cloud Open API Developer Guide
Appendix
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
87
HAT Cloud Open API Developer Guide
public static String sign(String accessSecret, TreeMap<String, String> params, HttpMethod method)
throws Exception {
String stringToSign = getStringToSign(params, method);
[Link]("StringToSign = [" + stringToSign + "]");
[Link] mac = [Link]("HmacSHA1");
[Link](new [Link]([Link](DEFAULT_CHARSET),
"HmacSHA1"));
byte[] signData = [Link]([Link](DEFAULT_CHARSET));
return new [Link].BASE64Encoder().encode(signData);
}
88
HAT Cloud Open API Developer Guide
89
HAT Cloud Open API Developer Guide
C#
using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace Demo
{
public class Demo
{
private const string ACCESS_KEY = "testKey";
private const string ACCESS_SECRET = "testSecret";
private const string SIGNATURE_METHOD = "HMAC-SHA1";
private const string DEFAULT_CHARSET = "UTF-8";
private const string REGION_ID = "cn-hangzhou";
private const string VERSION = "2.1.0";
private const string BASE_URL = "[Link]
[Link]("&").Append(specialUrlEncode([Link])).Append("=").Append(specia
90
HAT Cloud Open API Developer Guide
lUrlEncode([Link]));
}
string finalUrl = url + "?Signature=" + specialUrlEncode(sign) + [Link]();
using var client = new HttpClient();
HttpResponseMessage response = await [Link](finalUrl);
string content = await [Link]();
[Link](content);
}
91
HAT Cloud Open API Developer Guide
[Link]("&").Append(specialUrlEncode([Link])).Append("=").Append(specialUrlE
ncode([Link]));
}
return
$"{[Link]}&{specialUrlEncode("/")}&{specialUrlEncode([Link]().TrimStart
('&'))}";
}
Python 3
import requests
import json
import time
import uuid
import hmac
import hashlib
import base64
import [Link]
import unittest
import socket
from [Link] import quote
class HATCloudAPITest():
92
HAT Cloud Open API Developer Guide
base_url = "[Link]
access_key = "testKey"
access_secret = "testSecret"
product_key = ""
def setUp(self):
[Link] = [Link]()
[Link]({
"Content-Type": "application/json",
"Accept": "application/json"
})
sorted_params = sorted([Link]())
canonicalized_query_string = ""
for key, value in sorted_params:
canonicalized_query_string += "&" + self.special_url_encode(key) + "=" +
self.special_url_encode(value)
93
HAT Cloud Open API Developer Guide
canonicalized_query_string = canonicalized_query_string[1:]
params["Signature"] = signature
encoded_params = []
for key, value in sorted([Link]()):
encoded_params.append(f"{self.special_url_encode(key)}={self.special_url_encode(value)}")
return "&".join(encoded_params)
def get_common_params(self):
return {
"AccessKey": self.access_key,
"SignatureMethod": "HMAC-SHA1",
"SignatureNonce": str(uuid.uuid4()),
"Timestamp": str(int([Link]() * 1000)),
"RegionId": "cn-hangzhou",
"Version": "2.1.0"
}
94
HAT Cloud Open API Developer Guide
if params:
common_params.update(params)
if [Link]() == "GET":
encoded_params = self.generate_signature(common_params, method)
url = f"{url}?{encoded_params}"
print(f"DEBUG - Full Request URL: {url}")
response = [Link](url)
elif [Link]() == "POST":
encoded_params = self.generate_signature(common_params, method)
url = f"{url}?{encoded_params}"
print(f"DEBUG - Full Request URL: {url}")
response = [Link](url)
elif [Link]() == "DELETE":
encoded_params = self.generate_signature(common_params, method)
url = f"{url}?{encoded_params}"
print(f"DEBUG - Full Request URL: {url}")
response = [Link](url)
else:
raise ValueError(f"Unsupported HTTP method: {method}")
return response
except Exception as e:
print(f"Request failed: {e}")
raise
def test_list_device_protocols(self):
response = self.make_request("GET", "/protocol/query/")
print(response.status_code, [Link])
def test_list_devices(self):
response = self.make_request(
"GET",
95
HAT Cloud Open API Developer Guide
"/device/list/",
params={
"productKey": self.product_key,
"pageSize": 10,
"pageNo": 1
}
)
print(response.status_code, [Link])
def test_add_devices(self):
response = self.make_request(
"POST",
"/device/add/",
params={"deviceList": [Link](self.DEVICE_LIST)}
)
print(response.status_code, [Link])
DEVICE_LIST = [
{
"terminalID": "12345678910",
"productKey": self.product_key,
"language": "EN",
"deviceModel": "AE-AC1130-A",
"deviceName": "TEST1",
"deviceChannelList": [
{
"channelNum": 1,
"channelType": 0,
"channelName": "CH1"
}
]
}
]
96
HAT Cloud Open API Developer Guide
URL encoding
Character Encoding
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
/ %2F
: %3A
; %3B
< %3C
= %3D
> %3E
? %3F
@ %40
[ %5B
\ %5C
] %5D
^ %5E
` %60
{ %7B
| %7C
} %7D
97
HAT Cloud Open API Developer Guide
Code msg
1 service_unavailable
1 data_query_failed
1 get_preview_url_failed
1 get_record_url_failed
1 send_text_msg_failed
1 send_text_msg_timeout
1 request_timeout
1 get_video_list_failed
1 get_record_list_failed
1 get_image_list_failed
1 upload_failed
1 call_interface_failed
2 device_param_error
2 device_param_empty
2 device_code_invalid
2 param_illegal
2 channel_param_illegal
2 page_param_invalid
2 date_param_invalid
2 stream_type_param_invalid
98
HAT Cloud Open API Developer Guide
2 net_type_param_invalid
2 stream_protocol_param_invalid
2 store_type_param_invalid
2 param_invalid
2 speed_must_be_greater_than_zero
2 speed_out_of_range
2 get_preview_url_param_invalid
2 parse_time_error
2 resolution_param_error
2 quality_param_error
2 brightness_param_error
2 hues_param_error
2 saturation_param_error
2 contrast_param_error
2 no_this_task
2 add_device_num_limit_1000
2 callback_url_not_start_with_http
2 callback_url_invalid
2 host_and_port_cannot_reach
3 device_access_denied
3 product_key_access_denied
4 device_offline
4 device_sleep
4 device_unsupported
99
HAT Cloud Open API Developer Guide
100
HAT Cloud Open API Developer Guide
101
HAT Cloud Open API Developer Guide
"attachFlag":"Boolean Alert attachment flag, which is set to true to indicate that the message is an
attachment message ",
"attachInfo":"DownloadFileUrl Alarm attachment information. This field is valid when attachFlag is
true.",
"efcName":"String E-fence name",
"efcUuid":"String E-fence uuid",
"efcEventInfo":"EFCEventInfo E-fence Alarm details",
"limitState":"Integer limit(1:No entry;2:No exit:3:Lane departure)",
"position":"String position",
"moveState":"Integer Move state, 0:Stopped, 1:Runing",
"mcuVersion":"String MCU version",
"voltage":"Integer Battery voltage, *1000",
"temperature":"Integer Device temperature, *1000",
"wakeupType":"Integer Wakeup type",
"Tvistatus":"Integer Tvi status",
102
HAT Cloud Open API Developer Guide
DownloadFileUrl
{
"uploadState":"boolean Upload status",
"url":"String Url address",
"fileType":"Integer File type 0-jpg, 1-png, 2-wav, 3-mp4, 4-h264[A1] , 5-h265",
"fileSize":"Integer File size, in bytes",
"fileName":"String File name",
"uuid":"String uuid",
"alarmSignVo":"AlarmSignVo alarmSign",
"reason":"String Error code",
"totalNum":" Integer Total number",
"successNum":"Integer Success number",
"fileNameList":"List<String> File name list"
}
EFCEventInfo
{
"overSpeed":"Boolean Speed or not",
"distance":"Double Distance (must be if type is line)",
"deviation":"Boolean Whether to deviate (must be if type is line)",
103
HAT Cloud Open API Developer Guide
DeviceAttachInfo
{
"fileId":"Integer File Id in ISU",
"fileType":"Integer File type 0-jpg, 1-png, 2-wav, 3-mp4, 4-h254, 5-h265",
"size":"Integer File size",
"channelNo":"Integer Channel number",
"fileName":"String File name"
}
FaceRecognitionData
{
"result":"Integer Comparison result, 0: successful 1: failed",
"type":"Integer Business type 0: Facial check-in 1: Dynamic job search",
"similarityDegree":"Integer The similarity comparison is represented by 0-100, in %. The larger the
data value, the higher the matching degree. Valid when the comparison result is 0",
"score":"Integer The facial score is expressed as 0~100, in %. The larger the data value, the more
reliable it is for the face. Valid when the comparison result is 0",
"time":"String Reporting time in the device's time zone, yyyy-MM-dd HH:mm:ss",
"cardType":"Integer Certificate type, 0-Professional Qualification Certificate, 1-ID Card",
"cardNum":"String Card number",
"name":"String Personnel Name",
"driverID":"String Driver ID",
"channelNo":"Integer Channel number"
}
UPLOAD_FILE_COMPLETE(Alarm attach)
104
HAT Cloud Open API Developer Guide
{
"uploadState":"boolean Upload status",
"url":"String Url address",
"fileType":"Integer File type 0-jpg, 1-png, 2-wav, 3-mp4, 4-h264[A1] , 5-h265",
"fileSize":"Integer File size, in bytes",
"fileName":"String File name",
"uuid":"String uuid",
"alarmSignVo":"AlarmSignVo alarmSign",
"reason":"String Error code",
"totalNum":" Integer Total number",
"successNum":"Integer Success number",
"fileNameList":"List<String> File name list"
}
GPS(Gps data)
{
"messageSequence":"Integer message sequence",
"productKey":"String productKey",
"deviceSequence":"String deviceCode/terminalID",
"terminalPhoneNo":"String phone number",
"alarmStatusNum":"int Alarm status digit",
"vehicleStatusNum":"int Vehicle status digit",
"alarmStatus":"AlarmStatus Alarm status",
"vehicleStatus":"VehicleStatus Vehicle status",
"gpsValid":"Integer gps Valid, 0:invalid, 1:valid",
"divisionEW":"String E: East longitude, W: West longitude",
"divisionNS":"String N: North latitude, S: south latitude ",
"estimatedTime":"Long Estimated arrival time",
"autoDrive":"Integer Auto drive or not, 1: Yes 0: No",
"longitude":"Double longitude",
"latitude":"Double latitude",
"altitude":"Double altitude",
"speed":"Double speed",
"direction":"int Direction Angle (heading), 0~359, unit degree, 0 for true north, clockwise ",
105
HAT Cloud Open API Developer Guide
"collectTime":"String GPS reporting time in the device's time zone, yyyy-MM-dd HH:mm:ss ",
"utcTime":"String GPS reporting time in the UTC+0 time zone, yyyy-MM-dd HH:mm:ss ",
"plateNumber":"String Related car plate No.",
"t808EventDataList":"List<T808EventData> Additional information from 808 protocol",
"positionSignalStrength":"Integer Positioning signal strength",
"satelliteNum":"Integer Number of satellites",
"accStatus":"String ACC status",
"totalMileage":"Double Total mileage",
"supplementSign":"int 1: supplementary, 0: normal ",
"eventList":"List<EventInfo>"
}
Note
You can obtain the direction of longitude and latitude through vehicleStatusNum
/**
* Obtain the value of a binary digit based on its number of digits
*
* @param num:The number to obtain binary values
* @param index:The last digit is 0, and so on
*/
public static int getBinaryDigit(int num, int index) {
return (num & (0x1 << index)) >> index;
}
106
HAT Cloud Open API Developer Guide
DEVICE_STATE(Device Online/Offline)
{
"status":"Integer Online status, 0: offline, 1: online, 2: sleep",
"time":"String Update time in the UTC+0 time zone, yyyy-MM-dd HH:mm:ss"
}
Alarm Catagory
Alarm Alarm Type
Alarm Catagory (subtype Notes
(type) )
Speed -30 8 Valid field: areaType、areaId
Alarm(Device e-
fence)
Entry/exit -30 2 Valid field: areaType、areaId、efcType、
area(Device e- alarmSignVo、alarmSign
fence)
Driver attendance -30 11 Valid field: state、faceAttendanceData、
alarmSignVo、alarmSign、attachCount
IC card -30 11 Valid field: state、faceAttendanceData、uuid
attendance
Driver -30 10 Valid field: state、faceRecognitionData、
comparison result alarmSignVo、alarmSign、attachCount
Special exception -30 12 Valid field: state、
alarm abnormalReportingEventDataList、alarmSign
mileage -30 100 Valid field: state、alarmSign
FCW 100 1 Valid field: level、frontCarSpeed、frontDistance、
deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
107
HAT Cloud Open API Developer Guide
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
LDW 100 2 Valid field: level、frontCarSpeed、frontDistance、
deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Car approaching 100 3 Valid field: level、frontCarSpeed、frontDistance、
alarm deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
PCW 100 4 Valid field: level、frontCarSpeed、frontDistance、
deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Frequent lane 100 5 Valid field: level、frontCarSpeed、frontDistance、
change alarm deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Road sign 100 6 Valid field: level、frontCarSpeed、frontDistance、
exceeding limit deviationType、roadSignsType、roadSignsValue、
alarm speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
108
HAT Cloud Open API Developer Guide
109
HAT Cloud Open API Developer Guide
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Speed Alarm 100 31 Valid field: level、frontCarSpeed、frontDistance、
deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Zebra crossing 100 32 Valid field: level、frontCarSpeed、frontDistance、
speeding deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Failure to yield to 100 33 Valid field: level、frontCarSpeed、frontDistance、
pedestrians deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Illegal traffic 100 34 Valid field: level、frontCarSpeed、frontDistance、
occupation deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Running red lights 100 35 Valid field: level、frontCarSpeed、frontDistance、
deviationType、roadSignsType、roadSignsValue、
speed、altitude、latitude、longitude、time、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid 、
alarmSignVo、attachCount
Fatigue driving 101 1 Valid field: level、fatigueDegree、speed、
alarm altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
110
HAT Cloud Open API Developer Guide
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Cellphone use 101 2 Valid field: level、fatigueDegree、speed、
detection altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Smoking alarm 101 3 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Distracted driving 101 4 Valid field: level、fatigueDegree、speed、
alarm/yawning altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Driver abnormal 101 5 Valid field: level、fatigueDegree、speed、
alarm(including altitude、latitude、longitude、accState、
leaving) leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Camera shield 101 6 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Driver face 101 9 Valid field: level、fatigueDegree、speed、
recognization altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Seat belt 101 17 Valid field: level、fatigueDegree、speed、
detection altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
111
HAT Cloud Open API Developer Guide
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Seat belt 101 10 Valid field: level、fatigueDegree、speed、
detection altitude、latitude、longitude、accState、
(technical leftTurnState、rightTurnState、wiperState、
vehicle) brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Infrared blocking 101 11 Valid field: level、fatigueDegree、speed、
sunglasses altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Hands off the 101 18 Valid field: level、fatigueDegree、speed、
wheel(Double altitude、latitude、longitude、accState、
hands) leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Hands off the 101 13 Valid field: level、fatigueDegree、speed、
wheel(Single altitude、latitude、longitude、accState、
hand) leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Not wearing a 101 14 Valid field: level、fatigueDegree、speed、
helmet altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Automatic 101 16 Valid field: level、fatigueDegree、speed、
capture altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Door closing 101 29 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
112
HAT Cloud Open API Developer Guide
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Door opening 101 30 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Cellphone use 101 31 Valid field: level、fatigueDegree、speed、
detection altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Drunk driving 101 32 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Drink Driving 101 33 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Multiple face 101 48 Valid field: level、fatigueDegree、speed、
alarm altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Closed eyes alarm 101 34 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
AEB-F 101 101 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
113
HAT Cloud Open API Developer Guide
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Without a mask 101 100 Valid field: level、fatigueDegree、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Tire pressure 103 Valid field: state、speed、altitude、latitude、
alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount、
tirePressureInfo
Rear approach 102 1 Valid field: state、speed、altitude、latitude、
alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Left rear 102 2 Valid field: state、speed、altitude、latitude、
approach alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Right rear 102 3 Valid field: state、speed、altitude、latitude、
approach alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Forward 102 4 Valid field: state、speed、altitude、latitude、
approach alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Suspected illegal 102 5 Valid field: state、speed、altitude、latitude、
water injection longitude、accState、leftTurnState、
alarm rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Front ultrasonic 102 238 Valid field: state、speed、altitude、latitude、
alarm longitude、accState、leftTurnState、
114
HAT Cloud Open API Developer Guide
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Rear ultrasonic 102 239 Valid field: state、speed、altitude、latitude、
alarm longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Emergency alarm 102 240 Valid field: state、speed、altitude、latitude、
longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount
Rapid 104 1 Valid field: state、level、duration、
acceleration accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Rapid 104 2 Valid field: state、level、duration、
deceleration accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Collision 104 3 Valid field: state、level、duration、
accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Flip over 104 4 Valid field: state、level、duration、
accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
115
HAT Cloud Open API Developer Guide
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Sharp left turn 104 5 Valid field: state、level、duration、
accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Sharp right turn 104 6 Valid field: state、level、duration、
accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Sharp turn 104 7 Valid field: state、level、duration、
accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Severe 104 255 Valid field: state、level、duration、
turbulence accelerationThresholdValue、
accelerationImmediateValue、
angleThresholdValue、angleImmediateValue、
speed、altitude、latitude、longitude、
vehicleStatusNum、attachCount、alarmSignVo、
alarmSign
Temperature 170 Valid field: state、xAxis、yAxis、
measurement temperatureState、
alarm temperatureImmediateValueState、
temperatureThresholdState、
temperatureThreshold、
116
HAT Cloud Open API Developer Guide
temperatureImmediateValue、alarmAttribute、
alarmAttributeState、speed、altitude、latitude、
longitude、vehicleStatusNum、jt808Attach72Vo、
alarmSignVo、alarmSign
Driver ID 163 163 Valid field: cardType、cardCode
Right turn 238 1 Valid field: alarmId、state、speed、altitude、
overspeed latitude、longitude、vehicleStatusNum、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Turn right 238 2 Valid field: alarmId、state、speed、altitude、
without stopping latitude、longitude、vehicleStatusNum、
accState、leftTurnState、rightTurnState、
wiperState、brakingState、cardState、gpsValid、
attachCount、alarmSignVo、alarmSign
Lifting event 172 1 Valid field: state、level、speed、altitude、
latitude、longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount、
alarmSignVo、alarmSign
Closed event 172 2 Valid field: state、level、speed、altitude、
latitude、longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount、
alarmSignVo、alarmSign
Load event 172 3 Valid field: state、level、speed、altitude、
latitude、longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、attachCount、
alarmSignVo、alarmSign
Forward blind 249 (0xF9) 1 Valid field: state、level、duration、speed、
spot braking altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
117
HAT Cloud Open API Developer Guide
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Rear blind spot 249 2 Valid field: state、level、duration、speed、
braking altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Front ultrasonic 249 3 Valid field: state、level、duration、speed、
braking altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Rear ultrasonic 249 4 Valid field: state、level、duration、speed、
braking altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Left blind spot 249 5 Valid field: state、level、duration、speed、
braking altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
118
HAT Cloud Open API Developer Guide
119
HAT Cloud Open API Developer Guide
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Rear ultrasonic 249 24 Valid field: state、level、duration、speed、
warning altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
BSD-Left 249 25 Valid field: state、level、duration、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
BSD-Right 249 26 Valid field: state、level、duration、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
AEB-F 249 27 Valid field: state、level、duration、speed、
altitude、latitude、longitude、accState、
leftTurnState、rightTurnState、wiperState、
brakingState、cardState、gpsValid、
gearPosition、barrierType、barrierDistance、
turn、millimeterRadarStatus、
120
HAT Cloud Open API Developer Guide
ultraSonicRadarStatus、deviceExtraStatus、
attachCount、alarmSignVo、alarmSign
Actively report 160 0 Valid field: speed、altitude、latitude、
alarm events longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、pumperEventCount、
pumperEventList
Inspection report 160 1 Valid field: speed、altitude、latitude、
event longitude、accState、leftTurnState、
rightTurnState、wiperState、brakingState、
cardState、gpsValid、pumperEventCount、
pumperEventList
Emergency alarm 25 1 Valid field: state、alarmSubType、level、
qualificationNumber、attachCount、
alarmSignVo、alarmSign
Emergency alarm -32 0 Valid field: state、alarmSignVo、uuid、
createType、recorderSpeed、speed
Speed Alarm -32 16 Valid field: state、alarmSignVo、uuid、
createType、recorderSpeed、speed
Fatigue driving -32 32 Valid field: state、alarmSignVo、uuid、
createType、recorderSpeed、speed
Danger Warning -32 33 Valid field: state、alarmSignVo、uuid、
createType、recorderSpeed、speed
GNSS module -32 2 Valid field: state、alarmSignVo、uuid、
fault createType、recorderSpeed、speed
GNSS Antenna -32 3 Valid field: state、alarmSignVo、uuid、
not connected createType、recorderSpeed、speed
GNSS Antenna -32 4 Valid field: state、alarmSignVo、uuid、
short circuit createType、recorderSpeed、speed
Terminal main -32 5 Valid field: state、alarmSignVo、uuid、
power createType、recorderSpeed、speed
undervoltage
Terminal main -32 6 Valid field: state、alarmSignVo、uuid、
power down createType、recorderSpeed、speed
121
HAT Cloud Open API Developer Guide
122
HAT Cloud Open API Developer Guide
123
HAT Cloud Open API Developer Guide
Revision Records
● V1.0.0
Time:2024/12/09
1. Define the initial draft of the document
● V1.0.1
Time:2025/01/09
1. Correct the field name of AccessKeyId to be AccessKey
● V1.1.0
Time:2025/01/10
1. Add Message subscription (webhook) 2. Remove deprecated interfaces
● V1.1.1
Time:2025/01/15
1. Discard interface “List device models”
2. Add interface “List device protocols”
● V1.2.0
Time:2025/01/15
1. Add interface “Video Download Task”
2. Add interface “Device Maintenance”
● V1.2.1
124
HAT Cloud Open API Developer Guide
Time:2025/03/28
1. Add interface “Synchronize facial information”
2. Add interface “Distribute facial change information”
● V1.2.2
Time:2025/04/28
1. Add interface “Confirm emergency alarm”
2. Add interface “Set speed threshold”
● V1.2.3
Time:2025/09/04
1. Added new parameter “timeZone” to interface “Add Devices” and “Edit devices”
2. Add some descriptions
125
HAT Cloud Open API Developer Guide
126