This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
api [2023/05/08 17:31] nightfly |
api [2025/08/14 16:10] (current) nightfly |
||
|---|---|---|---|
| Line 30: | Line 30: | ||
| | | delete | cameraid | deletes specified camera | | | | delete | cameraid | deletes specified camera | | ||
| | | isregistered | ip | checks is some camera is registered by IP on NVR or not? | | | | isregistered | ip | checks is some camera is registered by IP on NVR or not? | | ||
| + | | | isipportfree | ip+port | ||
| | users | getall | | | users | getall | | ||
| | | create | login + password | | | create | login + password | ||
| Line 48: | Line 49: | ||
| | | getscreenshotsall | | returns array of all available channel screenshots | | | | getscreenshotsall | | returns array of all available channel screenshots | | ||
| | | getscreenshot | channelid | | | getscreenshot | channelid | ||
| - | | | getlivestream | channelid | + | | | getlivestream | channelid |
| | recorders | | recorders | ||
| | | isrunning | cameraid | | | isrunning | cameraid | ||
| Line 156: | Line 157: | ||
| ===== Storages states ===== | ===== Storages states ===== | ||
| + | **Request** | ||
| + | < | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | **Reply** | ||
| + | < | ||
| + | Array | ||
| + | ( | ||
| + | [13] => Array | ||
| + | ( | ||
| + | [state] => 1 | ||
| + | [total] => 968792403968 | ||
| + | [used] => 639428460544 | ||
| + | [free] => 329363943424 | ||
| + | ) | ||
| + | |||
| + | [1] => Array | ||
| + | ( | ||
| + | [state] => 1 | ||
| + | [total] => 31183237120 | ||
| + | [used] => 28042903552 | ||
| + | [free] => 3140333568 | ||
| + | ) | ||
| + | |||
| + | ) | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Existing cameras list ===== | ||
| + | |||
| + | |||
| + | **Request** | ||
| + | < | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | **Reply** | ||
| + | < | ||
| + | Array | ||
| + | ( | ||
| + | [54] => Array | ||
| + | ( | ||
| + | [CAMERA] => Array | ||
| + | ( | ||
| + | [id] => 54 | ||
| + | [modelid] => 11 | ||
| + | [ip] => 172.30.1.92 | ||
| + | [login] => admin | ||
| + | [password] => SomePassword | ||
| + | [active] => 1 | ||
| + | [storageid] => 1 | ||
| + | [channel] => kiqgdmrbma1 | ||
| + | [comment] => Here some camera description | ||
| + | [realport] => Here is camera RTSP port that depends template or custom port if set | ||
| + | [maxretention] => Here is maximum retention days limit or zero if no | ||
| + | ) | ||
| + | |||
| + | [TEMPLATE] => Array | ||
| + | ( | ||
| + | [DEVICE] => Hikvision DS-2CD1023G0E-I | ||
| + | [PROTO] => rtsp | ||
| + | [MAIN_STREAM] => /h264 | ||
| + | [SUB_STREAM] => /h264 | ||
| + | [RTSP_PORT] => 554 | ||
| + | [HTTP_PORT] => 80 | ||
| + | [SOUND] => 0 | ||
| + | ) | ||
| + | |||
| + | [STORAGE] => Array | ||
| + | ( | ||
| + | [id] => 1 | ||
| + | [path] => /wrstorage | ||
| + | [name] => Default | ||
| + | ) | ||
| + | |||
| + | [OPTS] => Array | ||
| + | ( | ||
| + | [id] => 1 | ||
| + | [cameraid] => 57 | ||
| + | [rtspport] => 666 | ||
| + | [keepsubalive] => 0 | ||
| + | [maxretdays] => 0 | ||
| + | [order] => | ||
| + | ) | ||
| + | |||
| + | ) | ||
| + | |||
| + | [33] => Array | ||
| + | ( | ||
| + | .... | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== User creation ===== | ||
| + | |||
| + | **Request** | ||
| + | < | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | **Request data** | ||
| + | < | ||
| + | $requestData=array( | ||
| + | ' | ||
| + | ' | ||
| + | ); | ||
| + | </ | ||
| + | |||
| + | **POST variable ' | ||
| + | < | ||
| + | |||
| + | {" | ||
| + | </ | ||
| + | |||
| + | **Reply** | ||
| + | < | ||
| + | |||
| + | |||
| + | Array | ||
| + | ( | ||
| + | [error] => 0 | ||
| + | [message] => Success | ||
| + | ) | ||
| + | </ | ||
| + | |||
| + | ===== Attempt to create existing user ===== | ||
| + | |||
| + | **Request** | ||
| + | < | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | **Request data** | ||
| + | < | ||
| + | $requestData=array( | ||
| + | ' | ||
| + | ' | ||
| + | ); | ||
| + | </ | ||
| + | |||
| + | **POST variable ' | ||
| + | < | ||
| + | |||
| + | {" | ||
| + | </ | ||
| + | |||
| + | **Reply** | ||
| + | < | ||
| + | Array | ||
| + | ( | ||
| + | [error] => 7 | ||
| + | [message] => User already exists | ||
| + | ) | ||
| + | </ | ||
| + | |||
| + | |||
| + | We hope it is clear how it works. You can also check out a sample implementation of this API at [[https:// | ||