1. API List
This section introduces the APIs of A1 series device linked detector.
API List:
No. | Function | Description |
---|---|---|
1 | Get Detector List | Search the A1 series device linked detector list. |
2 | Set Detector Status | Set the detector arming or disarming status. |
3 | Delete Detector | Delete the A1 series device linked detector. |
4 | Get IPC List to be Linked | Get IPC list which can be linked to A1 series device. |
5 | Get Linked IPC List | Get A1 series device linked IPC list. |
6 | Set the Linkage Relation between Detector and IPC | Set the Linkage Relation between A1 series device linked detector and IPC. |
7 | Edit Detector Name | Edit the detector name. |
8 | One-touch Clear Alarm for Device | The device clears the alarm remotely |
9 | Set device associated with detector | Set device associated with detector |
1.1 Get Detector List
Function
This API is used to get A1 series device linked detector list.
Request Address
`{areaDomain}/api/lapp/detector/list`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
HTTP Request Message
POST /api/lapp/detector/list HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=596510888
Returned Data
{ "result": {
"data": [ { "detectorSerial": "594012222", "detectorType": "callhelp", "detectorState": 1, "detectorTypeName": "Emergency Button, "location": "Emergency Button", "zfStatus": 0, "uvStatus": 0, "iwcStatus": 0, "olStatus": 0, "atHomeEnable": 1, "outerEnable": 1, "sleepEnable": 1, "updateTime": "2017-09-01 15:30:45" }, { "detectorSerial": "303333333", "detectorType": "waterlogging", "detectorState": 1, "detectorTypeName": "waterlogging", "location": "Washing Room", "zfStatus": 0, "uvStatus": 0, "iwcStatus": 0, "olStatus": 1, "atHomeEnable": 1, "outerEnable": 1, "sleepEnable": 1, "updateTime": "2017-09-01 15:30:45" } ], "code": "200", "msg": "Operation succeeded!"
} } </pre>
Returned Filed
Field | Type | Description |
---|---|---|
detectorSerial | String | Detector No. |
detectorType | String | Detector Type |
detectorState | int | Whether the device connects to A1:0-No, 1-Yes |
detectorTypeName | String | Detector Type Name |
location | String | Detector Location (Custom), which is corresponding to the edited name. |
zfStatus | int | Zone fault: 0- recover, 1- alarm |
uvStatus | int | Battery undervoltage:0- recover, 1-alarm |
iwcStatus | int | Wireless Interference:0- recover, 1- alarm |
olStatus | int | Offline:0-recover, 1- alarm |
atHomeEnable | int | Enable stay mode:0- disable, 1-enable |
outerEnable | int | Enable away mode:0-disable, 1-enable |
sleepEnable | int | Enable sleeping mode:0-disable, 1-enable |
The fault type has zone fault, battery undervoltage, wireless interference, and offline. "Alarm" means the fault generates, "Recovery" means fault recovery.
Detector Type Name:
Detector Type | Detector Type Name |
---|---|
V | Video Device |
I | Alarm-in Device |
O | Alarm-out Device |
PIR | IR Detector |
FIRE | Smoke Detector |
MAGNETOMETER | Magnetic Contact |
GAS | Combustible Gas |
WATERLOGGING | Water Leak |
CALLHELP | Emergency Button |
TELECONTROL | Remote Control |
ALERTOR | Alarm Device |
KEYBOARD | Keyboard |
CURTAIN | Curtain |
MOVE_MAGNETOMETER | Open-close Detector |
- Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.2 Set Detector Status
Function
The API is used to set the arming/disarming status for the detector which is linked to A1 series device, including stay, away and sleeping.
Request Address
`{areaDomain}/api/lapp/detector/status/set`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
detectorSerial | String | Detector No. | Y |
safeMode | int | Security mode:0- stay, 1-away, 2-sleeping |
Y |
enable | int | Status:0-disabled, 1-enabled |
Y |
- HTTP Request Message
POST /api/lapp/detector/status/set HTTP/1.1
Host: isgpopen.ezvizlife.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222&detectorSerial=604216666&enable=1&safeMode=2
- Returned Data
{
"code": "200",
"msg": "Operation succeeded!"
}
- Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20006 | Network exception. | Check the network status. Try again. |
20007 | The device is offline. | Check whether the device is online. |
20008 | Device requesting timeout. | No more operations. Try again. |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
60022 | It is the current status. | It is the current switch status. |
1.3 Delete Detector
Function
The API is used to delete the A1 series device linked detector.
Request Address
`{areaDomain}/api/lapp/detector/delete`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
detectorSerial | String | Detector No. | Y |
HTTP Request Message
POST /api/lapp/detector/delete HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222&detectorSerial=604216666
Returned Data
{ "code": "200", "msg": "Operation succeeded!" }
Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20006 | Network exception. | Check the network status. Try again. |
20007 | The device is offline. | Check whether the device is online. |
20008 | Device requesting timeout. | No more operations. Try again. |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.4 Get IPC List to be Linked
Function
The API is used to get IPC list which can be linked to A1 series device.
Request Address
`{areaDomain}/api/lapp/detector/ipc/list/bindable`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
HTTP Request Message
POST /api/lapp/detector/ipc/list/bindable HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222
Returned Data
{ "data": [
{ "deviceSerial": "428888888", "channelNo": 1, "cameraName": "Outdoor" }, { "deviceSerial": "426666666", "channelNo": 1, "cameraName": "Indoo" }
], "code": "200", "msg": "Operation succeeded!" } </pre>
Returned Filed
Field | Type | Description |
---|---|---|
deviceSerial | String | IPC serial No. |
channelNo | int | Channel No. |
cameraName | int | IPC Name |
- Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.5 Get Linked IPC List
Function
The API is used to get A1 series device linked IPC list.
Request Address
`{areaDomain}/api/lapp/detector/ipc/list/bind`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
detectorSerial | String | The detector No.. | Y |
HTTP Request Message
POST /api/lapp/detector/ipc/list/bind HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999
Returned Data
{ "data": [ {
"detectorSerial": "470289999", "ipcSerial": "558815555"
} ], "code": "200", "msg": "Operation succeeded!" } </pre>
Returned Filed
Field | Type | Description |
---|---|---|
deviceSerial | String | IPC serial No. |
ipcSerial | String | The linked IPC serial No.. |
- Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.6 Set Linkage Relation between Detector and IPC
Function
The API is used to set linkage relation between A1 series device linked detector and IPC.
Request Address
`{areaDomain}/api/lapp/detector/ipc/relation/set`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
detectorSerial | String | The detector No.. | Y |
ipcSerial | String | IPC serial No.. | Y |
operation | int | Operation: 0-delete, 1-bind | Y |
HTTP Request Message
POST /api/lapp/detector/ipc/relation/set HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999&ipcSerial=558815555&operation=0
Returned Data
{ "code": "200", "msg": "Operation succeeded!" }
Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20006 | Network exception. | Check the network status. Try again. |
20007 | The device is offline. | Check whether the device is online. |
20008 | Device requesting timeout. | No more operations. Try again. |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
60020 | The command is not supported. | Check whether the device supports IPC related functions. |
1.7 Edit Detector Name
Function
The API is used to edit the detector name.
Request Address
`{areaDomain}/api/lapp/detector/name/change`
Request Method
`POST`
Request Method
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
detectorSerial | String | The detector No.. | Y |
newName | String | New name, the length is less than 50 and without special characters. | Y |
HTTP Request Message
POST /api/lapp/detector/name/change HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999&newName=mydetector
Returned Data
{ "code": "200", "msg": "Operation succeeded!" }
Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20006 | Network exception. | Check the network status. Try again. |
20007 | The device is offline. | Check whether the device is online. |
20008 | Device requesting timeout. | No more operations. Try again. |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.8 One-touch Clear Alarm for Device
Function
The API is used to clear alarm for A1 series devices remotely (It should be supported by the device).
Request Address
`{areaDomain}/api/lapp/detector/cancelAlarm`
Request Method
`POST`
Request Parameters
Parameter | Type | Description | Required |
---|---|---|---|
accessToken | String | The access_token during authentication. | Y |
deviceSerial | String | The device serial No.. | Y |
HTTP Request Message
POST /api/lapp/detector/cancelAlarm HTTP/1.1 Host: isgpopen.ezvizlife.com Content-Type: application/x-www-form-urlencoded accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888
Returned Data
{ "code": "200", "msg": "Operation succeeded!" }
Returned Code
Returned Code | Returned Message | Description |
---|---|---|
200 | Operation succeeded. | Requesting succeeded. |
10001 | Parameters error. | Parameter is empty or the format is incorrect. |
10002 | accessToken exception or expired. | Get accessToken again. |
10005 | appKey exception. | appKey is frozen. |
20002 | Device does not exist. | |
20006 | Network exception. | Check the network status. Try again. |
20007 | The device is offline. | Check whether the device is online. |
20008 | Device requesting timeout. | No more operations. Try again. |
20014 | Network exception. | Check the network status. Try again. |
20018 | The user does not have this device. | Check whether the device belongs to the current account. |
49999 | Data exception. | Calling the API exception. |
1.9 Set device associated with detector
API Function
This interface is used to associate the device with the detector (the device needs to support remote association of the detector, and the distance between the device and the detector cannot exceed 1 meter)
Request Address
{areaDomain}/api/lapp/detector/add
Request Type
POST
Minimum permissions required for sub-account token requests
"Permission":"Config"
"Resource":"dev:dev: serial number"
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
accessToken | String | access_token obtained by the authorization process | Y |
deviceSerial | Strring | Device serial number | Y |
detectorSerial | String | detector serial number | Y |
detectorType | String | detector model (see [detector type description] (#detector_type)) | Y |
detectorCode | String | detector verification code (must enter ABCDEF ) |
Y |
Http Request Message
POST /api/lapp/detector/add HTTP/1.1 Host: http://localhost:8080 Content-Type: application/x-www-form-urlencoded accessToken=at.3y9qa2697b3eif5m4l20kla43ahb6wwk-3gml098d0z-0g4mher-wikgosg5m&deviceSerial=Q01478043&detectorSerial=Q00786518&detectorType=T2&detectorCode=ABCDEF
Http Request Message
{ "code": "200", "msg": "Operation succeeded" }
Return Code
Return code | Return message | Description |
---|---|---|
200 | Operate successfully | Requested successfully |
10001 | Parameter error | The parameter is empty or the format is incorrect |
10002 | Abnormal or expired AccessToken | re-accessAccessToken |
10005 | Abnormal appKey | appKey is frozen |
20002 | Device does not exist | |
20006 | Network anomaly | Check the device network status, try again later |
20007 | Device response timed out | Check if the device is online |
20008 | The device is not online | Operating too frequently, try again later |
20014 | deviceSerial is illegal | |
20018 | The user does not own the device | Check if the device belongs to the current account |
49999 | Data exception | Interface call exception |
50000 | Service exception | System service exception |
- Description of detector type
Detector model | Detector type | Detector type name |
---|---|---|
T4 | FIRE | Smoke Detector |
T3 | CALLHELP | Emergency Button |
T2 | MAGNETOMETER | Magnetic Contact |
T1 | PIR | IR Detector |
T5 | CURTAIN | Curtain |
K2 | TELECONTROL | Remote Control |
T6 | MOVE_MAGNETOMETER | Open-close Detector |
T9 | ALERTOR | Alarm Device |
T8 | GAS | Combustible Gas |
T10 | WATERLOGGING | Water Leak |