revision time:2023-12-13 14:30
Request path:
Public parameters
| Name | Description | Data type |
|---|---|---|
| code | return code(200 means correct,others means wrong,for details about the error return values, see the error code table) | int |
| msg | Descriptor | String |
| data | data | Object |
Public paging parameters
| Name | Description | Data type |
|---|---|---|
| index | Which page | int |
| size | Param pager_limits | int |
| total | total int | int |
| pages | total page | int |
| content | List Content | Array |
All subsequent requests need to be made with the request header "AccessToken"
GET
/researchapi/getAccessToken?appid=APPID&secret=SECRET
| Name | Description | Request type | Required' TRUE | Data type |
|---|---|---|---|---|
| appid | appid | query | true | String |
| secret | secret key | query | true | String |
Private parameters(The data in “data” )
| Name | Description | Data type |
|---|---|---|
| accessToken | accessToken | String |
| expiresIn | period of validity | int |
Request
/researchapi/getAccessToken?appid=APPID&secret=SECRET
Failure Response
{
"msg": "Secret error",
"code": 40003
}
Successful response
{
"msg": "success",
"code": 200,
"data": {
"accessToken": "a27462d98064b707f73fbd3341a1d5f1",
"expiresIn": 7200
}
}
POST
Content-Type: application/json;charset=UTF-8
Path
/researchapi/carlock/list
| Name | Description | Request type | Required' TRUE | Data type |
|---|---|---|---|---|
| index | Which page | query | true | int |
| size | Param pager_limits (Max:20) | query | true | int |
Private parameters(The data in “content”)
| Name | Description | Data type |
|---|---|---|
| did | unique device number | String |
| appid | appid | String |
| deviceName | device name | String |
| type | communication content(0= equipment direct connections, 1= gateway connection) | int |
| gateway | gateway | String |
| sim | Sim number | String |
| signalStrength | signal strength | int |
| electricity | battery | int |
| alarm | alarm status: 0= no alarm, normal , 1=Reverse pressure alarm under the condition of arm lifting, 2=Lift up alarm in falling arm state, 3= Blocked alarm when the arm rising, 4= Blocked alarm when the arm on the way down, 5=Lifting arm in wrong place, 6=time-limit exceeded | int |
| soundAlarm | Ultrasonic warning(0 means no alarm, 1 means alarm) | int |
| locationState | Position state(0-unknown, 1-down in the right place, 2- up in the right place) | int |
| online | Online status(0 means not synchronized, 1 means online, 2 means off-line) | int |
| syncTime | synchronization time(Time of the last synchronization)(timestamp) | long |
| createTime | Creation Time(timestamp) | long |
| updateTime | Update time(timestamp) | long |
| onlineTime | the last online time (timestamp) | long |
| offlineTime | the last off-line time(timestamp) | long |
Request
/researchapi/carlock/list
# Request Header
AccessToken:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Successful response
{
"msg": "success",
"code": 200,
"data": {
"index": 1,
"size": 10,
"total": 2,
"content": [
{
"did": "xxxxxx",
"appid": "xxxxxx",
"deviceName": "test2",
"type": 0,
"gateway": null,
"sim": null,
"signalStrength": 0,
"electricity": 100,
"alarm": -1,
"soundAlarm": 0,
"locationState": 0,
"online": 2,
"syncTime": 1677053427480,
"createTime": 1677053427480,
"updateTime": 1677053427480,
"onlineTime": 1677053427480,
"offlineTime": 1677053427480
},
{
"did": "xxxxxx",
"appid": "xxxxxx",
"deviceName": "21",
"type": 0,
"gateway": null,
"sim": null,
"signalStrength": 0,
"electricity": 80,
"alarm": -1,
"soundAlarm": 1,
"locationState": 0,
"online": 2,
"syncTime": 1677053427480,
"createTime": 1677053427480,
"updateTime": 1677053427480,
"onlineTime": 1677053427480,
"offlineTime": 1677053427480
}
],
"pages": 1
}
}
POST
Content-Type: application/json;charset=UTF-8
path
/researchapi/carlock/get
| Name | Description | Request type | required' TRUE | Data type |
|---|---|---|---|---|
| did | Device did | query | true | String |
Private parameters(The data in “content”)
| Name | Description | Data type |
|---|---|---|
| did | unique device number | String |
| appid | appid | String |
| deviceName | device name | String |
| type | communication content(0=equipment direct connections, 1= gateway connection) | int |
| gateway | gateway | String |
| sim | Sim number | String |
| signalStrength | signal strength | int |
| electricity | battery | int |
| alarm | alarm status: 0= no alarm, normal , 1=Reverse pressure alarm under the condition of arm lifting, 2=Lift up alarm in falling arm state, 3= Blocked alarm when the arm rising, 4= Blocked alarm when the arm on the way down, 5=Lifting arm in wrong place, 6=time-limit exceeded | int |
| soundAlarm | Ultrasonic warning(0 means no alarm, 1 means alarm) | int |
| locationState | Position state(0-unknown, 1-down in the right place, 2- up in the right place) | int |
| online | Online status(0 means not synchronized, 1 means online,2 means off-line) | int |
| syncTime | synchronization time(Time of the last synchronization) | long |
| createTime | Creation Time(timestamp) | long |
| updateTime | Update time(timestamp) | long |
| onlineTime | the last online time (timestamp) | long |
| offlineTime | the last off-line time(timestamp) | long |
Request
/researchapi/carlock/get
# Request Header
AccessToken:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"did": "11232a"
}
Failed response
{
"msg": "The parking lock does not exist under the account",
"code": 40020
}
Successful response
{
"msg": "success",
"code": 200,
"data": {
"appid": "admin",
"deviceName": "test2",
"imei": "100011",
"remark": "remark",
"deleted": 0,
"updateTime": 1677053427480,
"createTime": 1677053427480
}
}
POST
Content-Type: application/json;charset=UTF-8
path
/researchapi/carlock/control
| Name | Description | Request type | Required' TRUE | Data type |
|---|---|---|---|---|
| did | Device did | query | true | String |
| type | type:1: down,2: up | query | true | int |
Private parameters(The data in “content”)
| Name | Description | Data type |
|---|---|---|
| did | unique device number | String |
| mgId | operating information id (The success or failure of the operation is returned through a callback which is judged by mgid) | Long |
Request
/researchapi/carlock/control
# Request Header
AccessToken:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"did": "11232a",
"type": 1
}
Failed response
{
"msg": "The device is offline",
"code": 40021
}
Successful response
{
"msg": "success",
"code": 200,
"data": {
"did": "11232a",
"mgId": 1574667424362532864
}
}
POST
Content-Type: application/json;charset=UTF-8
path
/researchapi/carlock/controlUt
| Name | Description | Request type | required' TRUE | Data type |
|---|---|---|---|---|
| did | Device did | query | true | String |
| ut | Ultrasonic sensor time(0 seconds is the default,unit:second,it must be a multiple of 2)(2-98s)(no set,no transmit) | query | true | int |
Private parameters(The data in “content”)
| Name | Description | Data type |
|---|---|---|
| did | unique device number | String |
| mgId | operating information id (The success or failure of the operation is returned through a callback which is judged by mgid) | Long |
Request
/researchapi/carlock/controlUt
# Request Header
AccessToken:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"did": "11232a",
"ut": 20
}
Failed response
{
"msg": "The device is offline",
"code": 40021
}
Successful response
{
"msg": "success",
"code": 200,
"data": {
"did": "11232a",
"mgId": 1574667424362532864
}
}
POST
Content-Type: application/json;charset=UTF-8
path
/researchapi/carlock/resetRemoteControl
| Name | Description | Request type | required' TRUE | Data type |
|---|---|---|---|---|
| did | Device did | query | true | String |
Private parameters(The data in “content”)
| Name | Description | Data type |
|---|---|---|
| did | unique device number | String |
| mgId | operating information id (The success or failure of the operation is returned through a callback which is judged by mgid) | Long |
Request
/researchapi/carlock/deleteRemoteControl
# Request Header
AccessToken:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"did": "11232a"
}
Failed response
{
"msg": "The device is offline",
"code": 40021
}
Successful response
{
"msg": "success",
"code": 200,
"data": {
"did": "11232a",
"mgId": 1574667424362532865
}
}
Interface callback Pushes push device change information based on HTTP/HTTPS based POST requests
POST
| Parameter | Description |
|---|---|
| data | Data (callback data) |
| data.timestamp | Data generation timestamp (milliseconds) |
| checkcode | Data Verification code |
Example:
{
"checkcode": "4ce23fcc5ca766df900818a04337ea33",
"data": {
"imei": "0123456789",
"timestamp": 1663318173151,
"xxx":"xxx"
}
}
Example(java method)
/**
* 检查数据完整性 (检查数据完整性: Checking data integrity)
* check data integrity
*
* @param jsonObject 回调的数据 (回调的数据: Callback data)
* @param secret 密钥 (密钥: secret key)
*/
private static void checkData(JSONObject jsonObject, String secret) {
String checkcode = jsonObject.getString("checkcode");
JSONObject data = jsonObject.getJSONObject("data");
data.put("secret", secret);
StringBuffer stringBuffer = new StringBuffer();
data.keySet().stream().sorted(String::compareTo).forEach(a -> {
stringBuffer.append("&");
stringBuffer.append(a);
stringBuffer.append("=");
stringBuffer.append(data.get(a));
});
String s = SecureUtil.md5(stringBuffer.toString().substring(1));
if (Objects.equals(s, checkcode)) {
System.out.println("success");
} else {
System.out.println("error");
}
}
Parameter
| Name | Description | Data type |
|---|---|---|
| messageType | Type: 1. Online Note 2. Off-line Note 3. Notice of parking barrier information changing 4. Command status notification |
int |
| mgId | operating record id | long |
| errorCode | Code of sending a error command, 0 means correct | int |
| errorReason | cause of failure | String |
| did | unique device number | String |
| appid | appid | String |
| deviceName | Device name | String |
| type | communication content(0 : equipment direct connections,1 : gateway connection) | int |
| gateway | gateway | String |
| sim | Sim number | String |
| signalStrength | signal strength | int |
| electricity | battery | int |
| alarm | alarm status: 0= no alarm, normal , 1=Reverse pressure alarm under the condition of arm lifting, 2=Lift up alarm in falling arm state, 3= Blocked alarm when the arm rising, 4= Blocked alarm when the arm on the way down, 5=Lifting arm in wrong place, 6=time-limit exceeded | int |
| soundAlarm | Ultrasonic warning(0 means no alarm, 1 means alarm) | int |
| locationState | Position state(0-unknown, 1-down in the right place, 2- up in the right place) | int |
| online | Online status(0 means not synchronized, 1 means online,2 means off-line) | int |
| syncTime | synchronization time(Time of the last synchronization) | long |
| createTime | Creation Time(timestamp) | long |
| updateTime | Update time(timestamp) | long |
| onlineTime | the last online time (timestamp) | long |
| offlineTime | the last off-line time(timestamp) | long |
Example
{
"checkcode": "9285a452a708a1aea00d715a81701de0",
"data": {
"alarm": 0,
"appid": "xxxxxxx",
"createTime": 1677053427480,
"deleted": 0,
"deviceName": "test2",
"did": "xxxxxxx",
"electricity": 100,
"locationState": 0,
"messageType": 2,
"offlineTime": 1677053427480,
"online": 2,
"remark": "remark",
"signalStrength": 0,
"soundAlarm": 0,
"syncTime": 1677053427480,
"timestamp": 1664267176454,
"type": 0,
"updateTime": 1677053427480
}
}
Example
{
"checkcode": "4000d74ab2f17f5e9aec596bef83f1e9",
"data": {
"alarm": 0,
"appid": "xxxxxx",
"createTime": 1677053427480,
"deleted": 0,
"deviceName": "test2",
"did": "11232a",
"electricity": 100,
"locationState": 0,
"messageType": 1,
"offlineTime": 1677053427480,
"online": 1,
"remark": "remark",
"signalStrength": 0,
"soundAlarm": 0,
"syncTime": 1677053427480,
"timestamp": 1664267219362,
"type": 0,
"updateTime": 1677053427480
}
}
Example
{
"checkcode": "43347b8a89aba43351ef2147bc727344",
"data": {
"alarm": 0,
"appid": "xxxxxx",
"createTime": 1677053427480,
"deleted": 0,
"deviceName": "test2",
"did": "xxxxxx",
"electricity": 100,
"locationState": 0,
"messageType": 3,
"offlineTime": 1677053427480,
"online": 2,
"remark": "remark",
"signalStrength": 0,
"soundAlarm": 0,
"syncTime": 1677053427480,
"timestamp": 1664266916366,
"type": 0,
"updateTime": 1677053427480
}
}
Example
{
"checkcode": "ee12ec3a5d25053f85f90db572ee2ab8",
"data": {
"did": "11232a",
"errorCode": 40035,
"errorReason": "The parking lock is being operated",
"messageType": 4,
"mgId": 1574667424362532864,
"timestamp": 1664266824398
}
}
| error code(code) | Error |
|---|---|
| 30000 | Parameter error |
| 40000 | Service exception, please contact admin |
| 40001 | AccessToken expired |
| 40002 | Illegal AppID, please check the correctness of AppID to avoid abnormal characters and pay attention to case |
| 40003 | Secret error |
| 40007 | Parameter type error |
| 40020 | The parking lock does not exist under the account |
| 40021 | The parking lock is offline |
| 40022 | Error in instruction issued by equipment |
| 40023 | Error in data saving, please try again later |
| 40024 | The position status of the parking lock is already down |
| 40025 | The position status of the parking lock is already up |
| 40031 | The gateway message queue is full, please try again later |
| 40032 | Parking lock and gateway connection timed out |
| 40033 | Abnormal disconnect between parking lock and gateway |
| 40034 | The gateway don’t support the command code |
| 40035 | The parking lock is being operated |
| 40036 | Gateway Time-limit exceeded |
| 40037 | Gateway response timeout |
| 40039 | Unknown error in gateway (please contact admin) |
| 40041 | Reverse pressure alarm under the condition of arm lifting |
| 40042 | Lift up alarm in falling arm state |
| 40043 | Blocked alarm when the arm rising |
| 40044 | Blocked alarm when the arm on the way down |
| 40045 | Lifting arm in wrong place |
| 40046 | The parking lock time-limit exceeded |
| 40049 | Unknown error in parking lock (please contact admin) |
| 40080 | IP is not in the product whitelist |
| 40090 | No permission for this product |