1.Activation
Description
This API is used to activate the IPC, connected to the Internet is required.
All of the existing groups and records will be deleted after the activation and two default groups will be created: stranger and regulart.
Request link
https://192.168.0.1/openapi/device/activate, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
Parameter | Type | Description | Required |
app_id | string | User application ID, used as public parameter | Y |
timestamp | long | Unix timestamp in second | Y |
random | long | A 6-10 digits random number | Y |
sn | string | Device SN | Y |
sign | string | Signature of the request | Y |
Please refer to 1.5.4 Signature Rules and replace the Secret Key with the OpenAPI Activation Number to generate the signature.
For example, if you have the following parameters:
app_id: JO83UNV983U9OR random: 289192 sn: FS101D8BS00106 timestamp: 1593029283 |
The OpenAPI Activation Number is 12345678
Then the signature is:
str1=”app_id=JO83UNV983U9OR&random=289192&sn=FS101D8BS00106×tamp=1593029283″ str2 = str1 + “&key=12345678” sign = MD5(str2).upper() |
The parameters in the final HTTP request are:
app_id:JO83UNV983U9OR random:289192 sn:FS101D8BS00106 timestamp:1593029283 sign:72CB1C1031D3BA103D2FA1A57E171C2D |
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 2, 3, 4, 8, 9, 10, 11, see Error Code for further details. |
Request Example
POST /openapi/device/activate HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=JO83UNV983U9OR&random=289192&sn=FS101D8BS00106×tamp=1593029283&sign=72CB1C1031D3BA103D2FA1A57E171C2D |
Response Example
{ “code”: 0, } |
2.Get Basic Informations
Description
This API is used to get basic informations of the IPC.
Request link
https://192.168.0.1/openapi/device/getInfo, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
No private parameter for this API, please refer to Public Parameters for more details.
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 2, 3, 5, 7, see Error Code for further details. |
sn | string | Device SN |
model_name | string | Model name |
name | string | Device name |
software_version | string | Software version |
hardware_version | string | Hardware version |
ip | string | IP address |
mac | string | MAC address |
Request Example
POST /openapi/device/getInfo HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=15930292837&sign=IDKNFLK392038KDS932K& |
Response Example
{ “code”: 0, “data”: { “sn”: “SS101D8BS00083”, “model_name”: “FS”, “name”: “My FS”, “software_version”: “1.1.0”, “hardware_version”: “1.0.0”, “ip”: “192.168.0.1”, “mac”: “04:12:24:E3:45:12 “ } } |
3.Restore Factory Settings
Description
This API is used to restore the IPC to factory settings.
Request link
https://192.168.0.1/openapi/device/reset, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
No private parameter for this API, please refer to Public Parameters for more details.
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 2, 3, 5, 7, see Error Code for further details. |
Request Example
POST /openapi/device/reset HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=15930292837&sign=IDKNFLK392038KDS932K |
Response Example
{ “code”: 0, } |
4.Reboot
Description
This API is used to reboot the IPC.
Request link
https://192.168.0.1/openapi/device/reboot, 192.168.0.1 should be replaced by the IP address of the IPC.
Request Parameters
No private parameter for this API, please refer to Public Parameters for more details.
Response Parameters
Parameter | Type | Description |
code | int | Return code, represent the request result, possible return codes are 0, 1, 2, 3, 5, 7, see Error Code for further details. |
Request Example
POST /openapi/device/reset HTTP/1.1 Host: 192.168.0.1 Content-Type: application/x-www-form-urlencoded app_id=mdk923idkf&random=289192×tamp=15930292837&sign=IDKNFLK392038KDS932K |
Response Example
{ “code”: 0, } |