0% found this document useful (0 votes)
10 views33 pages

Sagitech HTTPServerAPI en

The document provides an overview of the Sagitech VMS HTTP Server API version 2.5.11, detailing various commands and functionalities such as connecting to the server, camera management, recording controls, and streaming options. It includes specific API endpoints for tasks like listing cameras, starting and stopping recordings, and retrieving camera states. Additionally, the document outlines user authentication methods and parameters for customizing requests to the server.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views33 pages

Sagitech HTTPServerAPI en

The document provides an overview of the Sagitech VMS HTTP Server API version 2.5.11, detailing various commands and functionalities such as connecting to the server, camera management, recording controls, and streaming options. It includes specific API endpoints for tasks like listing cameras, starting and stopping recordings, and retrieving camera states. Additionally, the document outlines user authentication methods and parameters for customizing requests to the server.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

sagitechlab.

com

Sagitech VMS
HTTP Server API
Version 2.5.11
Content
1. Connect to Server .................................................................................................................... 5
2. General Parameters................................................................................................................. 5
3. Verify Authorization ................................................................................................................ 5
4. List Cameras............................................................................................................................. 5
5. List Unavailable Camera IDs .................................................................................................... 6
6. Get Camera State .................................................................................................................... 6
7. User Web Interface Configuration .......................................................................................... 7
8. Start Recording ........................................................................................................................ 7
9. Stop Recording ........................................................................................................................ 7
10. Get Current Frame .............................................................................................................. 7
11. Stream Video (Original Format) .......................................................................................... 8
12. Stream Video (MJPEG) ........................................................................................................ 8
13. Stream Video (MPEG-TS) .................................................................................................... 9
14. Stream Audio (PCM or AAC)................................................................................................ 9
15. Control PTZ .......................................................................................................................... 9
16. Events ................................................................................................................................10
16.1. Subscribe to Events.......................................................................................................10
16.2. Poll Events.....................................................................................................................10
16.3. Search Events ................................................................................................................11
16.4. Get Frame for Event......................................................................................................11
16.5. Generate Event .............................................................................................................12
17. Archive: Play Frame-by-frame (JPEG) ...............................................................................13
17.1. Initialize Session ............................................................................................................13
17.2. Get Current/Next Video Frame ....................................................................................13
17.3. Get Current Time ..........................................................................................................13
17.4. Get Current Audio Frames ............................................................................................14
17.5. Close Session.................................................................................................................14
18. Archive: Stream in Original Format ...................................................................................14
18.1. Initialize Session ............................................................................................................14
18.2. Get Data Stream ...........................................................................................................15
18.3. Control Playback Speed ................................................................................................15
18.4. Close Session.................................................................................................................16
19. Archive: Stream Video (MJPEG) ........................................................................................16
20. Archive: List Records by Date ............................................................................................16
2
21. Archive export ...................................................................................................................17
21.1. Initialize Session ............................................................................................................17
21.2. Check Export Status ......................................................................................................17
21.3. Download Export File ....................................................................................................18
21.4. Cancel Export ................................................................................................................18
22. Archive: Get Single Frame .................................................................................................18
23. Get Current User Permissions ...........................................................................................19
24. Get Cameras ......................................................................................................................19
25. Get Layouts .......................................................................................................................19
26. Get Shared Layouts ...........................................................................................................20
27. Get Recording Profiles.......................................................................................................21
28. Get Disks............................................................................................................................22
29. Get User Actions ...............................................................................................................22
30. Execute User Action ..........................................................................................................22
31. Get Basic Configuration.....................................................................................................22
32. Get RDC RFID Events .........................................................................................................23
33. Check Video Analytics Module Availability .......................................................................23
34. People Counter Module ....................................................................................................23
34.1. Get Status .....................................................................................................................23
34.2. Reset Status ..................................................................................................................24
35. Queue Detection Module: Get Status ...............................................................................24
36. Heatmap Module: Generate Heatmap Image ..................................................................24
37. License Plate Recognition Module ....................................................................................25
37.1. Manage Cards ...............................................................................................................25
37.2. Manage Groups ............................................................................................................27
37.3. Get Parking Information ...............................................................................................27
38. Face Recognition Module..................................................................................................28
38.1. Manage Cards ...............................................................................................................28
38.2. Manage Groups ............................................................................................................29
38.3. Verify by ACS Card Number ..........................................................................................30
38.4. Verify by Photo .............................................................................................................30
38.5. Control Recognition from External System ..................................................................31
38.6. Subscribe to Events.......................................................................................................31
38.7. Search Archived Events.................................................................................................32
38.8. Analytics: Get Status .....................................................................................................33

3
38.9. Analytics: Reset Status ..................................................................................................33

4
1. Connect to Server
Operations to interact with the Sagitech VMS server are performed with the
HTTP API. The module responsible for HTTP connections (HTTP server) is enabled by
default, accepting connections on port 11012. You can change its settings by using the
Server Configuration Wizard.

2. General Parameters
For all commands to interact with the server authentication is required. The commands
support authorization with URL, or Basic Auth. For example, for the command
"/rsapi/cameras” (load camera list), the following options are possible:
• URL authorization with password. The user and password parameters are added to the
connection string, and the password is not encrypted:
[Link]
• URL authorization with password encrypted by MD5 algorithm. The user and MD5
password hash are added to the connection string. Note that the hash uses Unicode,
not ASCII. Request example:
[Link]
4404910d7b21397c59b39
You can get the password hash using the utility [Link] included in the
delivery package:
"C:\Program Files\Sagitech VMS\[Link]" -hashpassword test
• Basic Auth. It is performed in the usual way for HTTP using the ‘Authorization’ field
of the HTTP request:
GET /rsapi/cameras/ HTTP/1.1
Authorization: Basic aHR0cHdhdGNoOmY=

For all commands, the ‘rand’ parameter can be used to avoid caching by the
browser. Example:
[Link]
2343
For all commands that use a unique camera ID in the system, it is possible to
replace the ID with the order number of the camera in the configuration:
[Link]

3. Verify Authorization
Command:
/rsapi/auth
Example:
GET [Link]
Description:
Allows you to check whether the username and password are correct. If
authorization was successful, HTTP 200 OK is returned, if not, 401 Unauthorized.

4. List Cameras
Command:
/rsapi/cameras{?timeKind=local/utc}
Example:
GET [Link]
Description:
The command allows you to download the list of cameras from the server in XML
format. It’s possible to specify the time format to use – local server time or UTC
time.
Example of a server response (configuration of two cameras):
5
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Cameras>
<Camera>
<ID>6b658ca5-f23b-40fa-a898-4415ba93ac13</ID>
<Name>Beward B1062xx</Name>
<Description></Description>
<Disabled>false</Disabled>
<ModelName>Beward B1062xx</ModelName>
<ReceiveAudio>true</ReceiveAudio>
<SecondSourceEnabled>true</SecondSourceEnabled>
<PtzMoveEnabled>false</PtzMoveEnabled>
<PtzZoomEnabled>false</PtzZoomEnabled>
<ArchiveStart>2013-07-11T10:06:46.17</ArchiveStart>
<ArchiveEnd>2013-07-12T17:02:44.737</ArchiveEnd>
</Camera>
<Camera>
<ID>34690399-9a7a-4c1f-99ea-097498a84c0d</ID>
<Name>Beward BD4330RVZH</Name>
<Description></Description>
<Disabled>false</Disabled>
<ModelName>Beward BD4330xx</ModelName>
<ReceiveAudio>false</ReceiveAudio>
<SecondSourceEnabled>false</SecondSourceEnabled>
<PtzMoveEnabled>false</PtzMoveEnabled>
<PtzZoomEnabled>true</PtzZoomEnabled>
<ArchiveStart>2013-07-11T04:22:08.277</ArchiveStart>
<ArchiveEnd>2013-07-11T11:40:59.117</ArchiveEnd>
</Camera>
</Cameras>

Comments:
• ID – unique identifier of the camera in the system.
• Name – camera’s name.
• Description – camera’s description.
• Disabled – flag, that determines whether the camera is disabled on the server or
not.
• ModelName – model’s name.
• SecondSourceEnabled – flag is “true” if camera has 2 sources.
• PtzMoveEnabled – flag is “true” if camera's driver supports PTZ managing.
• PtzZoomEnabled – flag is “true” if camera’s driver supports PTZ optical zoom.
• ArchiveStart – date and time when the camera started recording.
• ArchiveEnd – date and time when the camera ended recording.

5. List Unavailable Camera IDs


Command:
/rsapi/unavailablecameraids
Request example:
GET [Link]
Response example:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<CameraIDs>
<CameraID>6c640962-7e41-49b7-9d40-09433eec6057</CameraID>
<CameraID>b4319e50-b99b-4057-b098-4e651179ef9c</CameraID>
</CameraIDs>
Description:
Returns the list of camera IDs that are currently unavailable (it is not possible to get
at least one video or audio stream).

6. Get Camera State


Command: /rsapi/camerastate?id=[CameraID]
Request example:
GET [Link]
b31d-fe0085fc4712
Response example:
6
<CameraStateInfo>
<ID>a3300d2c-4771-4fcc-b31d-fe0085fc4712</ID>
<Name>FR-Camera</Name>
<FullGroupName>GroupN2</FullGroupName>
<State>Writing</State>
</CameraStateInfo>
Description:
Returns camera status. The ‘State’ field can be one of the following values:
Disabled (camera is disabled), Error (connection error), RecordingIsOff (recording
is disabled), Writing (recording is in process), NotWriting (recording is not active).

7. User Web Interface Configuration


Command:
/rsapi/configuration/userwebconfig
Request example:
GET [Link]
Response example:
<Configuration>
<Settings>
<SelectedProfileID>00000000-0000-0000-0000-000000000000</SelectedProfileID>
</Settings>
<ViewProfiles/>
</Configuration>
Description:
Provides access to user’s web interface configuration with REST API. GET
command returns saved configuration, POST or PUT command saves configuration,
DELETE command removes saved configuration.

8. Start Recording
Command:
/rsapi/startrecord?id=[CameraID]&length=[timeduration]
Example:
GET [Link]
9934-7dc458e98066&length=3600
Description:
Enables data recording from the specified camera for the requested number of
seconds.
Parameters:
• id – unique id of the camera in the system.
• length – required recording duration in seconds. Available values: from 10 to
86400.

9. Stop Recording
Command:
/rsapi/stoprecord?id=[CameraID]
Example:
GET [Link]
9934-7dc458e98066
Description:
Stops a record started by a command or operator. This would not stop a recording
process started by the detector and would not work in constant recording mode.
Parameters:
• id – unique id of the camera in the system.

10. Get Current Frame


Command:

7
/rsapi/snapshot?id=[CameraId]{&viewSize=[width]x[height]}{&timeKind
=local/utc}
Example:
GET [Link]
9934-7dc458e98066&viewSize=320x240
Description:
Getting a single current frame from the camera in JPEG format.
Parameters:
• id – unique id of the camera in the system.
• viewSize – an optional parameter that allows to resize the frame to the size of
the specified viewport. Since the frame is compressed with a factor that is a
multiple of 2, the adjustment does not occur to the exact size of the area. If this
parameter is omitted, the command returns the frame in its original resolution.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

11. Stream Video (Original Format)


Command:
/rsapi/stream?id=[CameraID]&framerate=[fps]&streamIndex=[StreamID]
]}{&timeKind=local/utc}
Example: GET [Link]
9934-7dc458e98066&framerate=10
Description:
In response to this request, the server starts sending the video over HTTP in the
format in which the camera sends it. The format is specified in the header of each
frame in the Content-Type field. One of four values is possible. For H.264, H.265
and mpeg4, the frame type is also specified:
Content-Type: image/jpeg
Content-Type: rsvid/h264; frametype=I
Content-Type: rsvid/h265; frametype=I
Content-Type: rsvid/mpeg4; frametype=I
Parameters:
• id –unique id of the camera in the system.
• framerate – frames per second.
• streamIndex – stream index (0 – main, 1 – sub).
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

12. Stream Video (MJPEG)


Command:
/rsapi/mjpeg?id=[CameraID]&framerate=[fps]{&viewSize=[width]x[heigh
t]}{&timeKind=local/utc}
Example: GET [Link]
9934-7dc458e98066&framerate=10&viewSize=320x240
Description:
In response to this request, the server starts sending the video in the MJPEG format.
If the camera returns the video in a different format then the server reencodes the
video.
Parameters:
• id – unique id of the camera in the system.
• framerate – frames per second.
• viewSize – an optional parameter indicates the need to adjust the frame size to
the size of the specified viewport. Since the frame is compressed with a factor

8
that is a multiple of 2, the adjustment does not occur to the exact size of the
area. If this parameter is omitted, the command returns the frame in its original
resolution.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

13. Stream Video (MPEG-TS)


Command:
/rsapi/mpeg-ts/stream.m3u8?id=[CameraID]&streamIndex=[StreamID]
Exaple: GET [Link]
ts/stream.m3u8?id=7f019a68-c364-430e-9934-7dc458e98066
Description:
In response to this request, the server starts sending the video over HTTP in
MPEG-TS format. This feature is only available if the camera encodes the video
stream in H.264.
Parameters:
• id – unique id of the camera in the system.
• streamIndex – stream index. Available values: 0 – main, 1 – sub.

14. Stream Audio (PCM or AAC)


Command:
/rsapi/audio?id=[CameraID]&format=[AudioFormat]
Example:
GET [Link]
7dc458e98066&format=PCM
Description:
In response to this request, the server starts sending audio over HTTP in the
specified format. The format and parameters of the audio frame are specified in the
header of each frame in the Content-Type field:
Content-Type: PCM; sampleFrequency=8000; bitsPerSample=16;
numberOfChannels=1; specificParam=0
Parameters:
• id – unique id of the camera in the system.
• format – audio format. Available values: PCM, AAC.

15. Control PTZ


Command:

/rsapi/ptzcontrol?id=[CameraID]&action=[Action]{&presetNum=[PresetN
umber]}
Example:
GET [Link]
aaa0-abdeb09ea55d&action=left
Description:
Control of the rotary module and the optical zoom of the camera.
Parameters:
• id – unique id of the camera in the system.
• action – PTZ action. Available values: Home, Right, RightUp, Up, LeftUp,
Left, LeftDown, Down, RightDown, ZoomIn, ZoomOut, FocusIn, FocusOut,
FocusAuto, IrisIn, IrisOut, IrisAuto, SetPreset, ClearPreset, CallPreset.
• presetNum – preset number for the SetPreset, ClearPreset and CallPreset
actions.

9
16. Events
16.1. Subscribe to Events
Command:
/rsapi/getalarm{?level=[Level]}
Request example:
GET [Link]
Response example:
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace;boundary=--myboundary

--myboundary
Content-Type: text/plain

Level=Alarm;Type=Sabotage;CameraID=df09b965-96bc-4604-9e34-
32b071f282c4;EventID=221356db-ead7-4d07-b4be-297c29580a05;Time=2019-01-24T12:00:01

--myboundary
Content-Type: text/plain

--myboundary
Content-Type: text/plain

--myboundary
Content-Type: text/plain

Level=Notification;Type=LPR;CameraID=e84eac52-4f85-402c-9055-
7a4b34360fa9;EventID=6fbaa45d-554f-4430-8486-bd5a92378a78;Time=2019-01-
24T12:00:02;Plate=E436EP18
--myboundary
Content-Type: text/plain
.....
Description:
Receive alarm events and server notifications in real time as a text data stream.
When a connection is established, the server will push events as they occur. No
session duration limit.
Parameters:
• level – an optional parameter that allows you to specify the alarm level of the
event. If not specified, information of all levels will be sent. Available values:
alarm, notification, error.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
16.2. Poll Events
Command:
/rsapi/getcurrentevents?sessionid=[SessionID]
Request example:
GET [Link]
{126C98F4-CE73-4825-B9FC-CAEF22AC146B}
Response example:
HTTP/1.1 200 OK
Content-Type: text/xml

<EventInfos>
<EventInfo>
<ID>6f87387e-3ea7-4bb2-b361-e3d786c157b9</ID>
<Type>LPR</Type>
<TypeDescription>License plate detected</TypeDescription>
<Level>Notification</Level>
<Time>2022-10-07T16:42:42.971</Time>
<CameraID>a33f8200-1b78-4021-8387-8cb5a71e51c5</CameraID>
<CameraName>LPR</CameraName>
<ShortDescription>O913XO18</ShortDescription>
<LongDescription>Plate: O913XO18 Direction: Top to down Passage:
Undefined</LongDescription>
<CsvDescription>Plate=O913XO18;Direction=TopDown;Passage=None</CsvDescription>
<IsFrameAttached>false</IsFrameAttached>

10
<Rect/>
</EventInfo>
</EventInfos>
Description:
Receive alarm events and server notifications in real time as an XML data stream.
The first request creates a session with the given identifier. Subsequent queries
return events that have occurred since the last request.
Parameters:
• sessionId –session identifier. It is used either to create a new session or to
search for an already established session.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
16.3. Search Events
Command:
/rsapi/searchevents?timeFrom={[StartTime]}{&timeTo=[EndTime]}{&leve
ls=[Levels]}{&cameraids=[CameraIDList}{&lastminutes=[Minutes]}{&tim
eKind=local/utc}
Request example:
GET
[Link]
Response example:
HTTP/1.1 200 OK
Content-Type: text/xml

<EventInfos>
<EventInfo>
<ID>6f87387e-3ea7-4bb2-b361-e3d786c157b9</ID>
<Type>LPR</Type>
<TypeDescription>License plate detected</TypeDescription>
<Level>Notification</Level>
<Time>2022-10-07T16:42:42.971</Time>
<CameraID>a33f8200-1b78-4021-8387-8cb5a71e51c5</CameraID>
<CameraName>LPR</CameraName>
<ShortDescription>O913XO18</ShortDescription>
<LongDescription>Plate: O913XO18 Direction: Top to down Passage:
Undefined</LongDescription>
<CsvDescription>Plate=O913XO18;Direction=TopDown;Passage=None</CsvDescription>
<IsFrameAttached>false</IsFrameAttached>
<Rect/>
</EventInfo>
</EventInfos>
Description:
Load alarm events and server notifications from the archive in XML format.
Parameters:
• timeFrom – the beginning of the time interval for data loading. To not be
specified if lastMinutes is set.
• timeTo – the end of the time interval for data loading. To not be specified if
lastMinutes is set.
• levels – optional parameter. A list of event alarm levels separated by commas.
• cameraIds – optional parameter. A list of camera identifiers separated by
commas.
• lastMinutes – alternative option for specifying the time interval (a number of
minutes before now).
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
16.4. Get Frame for Event
Command:

11
/rsapi/
geteventsnapshot?eventid=[EventID]&eventtime=[EventTime]{&timeKind=
local/utc}
Example:
GET [Link]
ead7-4d07-b4be-297c29580a05&eventtime=2019-01-24T12:00:01
Description:
Get a JPEG frame linked to the specified event.
Parameters:
• eventid – unique event ID in the system.
• eventtime – event time.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
Note:
Applicable only to events from license plate recognition and face recognition
modules.
16.5. Generate Event
Command: /rsapi/raiseevent
Request example:
POST [Link]
Content-Type: text/xml

<EventInfo>
<ID>6f87387e-3ea7-4bb2-b361-e3d786c157b9</ID>
<Type>External</Type>
<Level>Alarm</Level>
<Time>2022-10-07T16:42:42.971</Time>
<TimeKind>local</TimeKind>
<CameraID>a33f8200-1b78-4021-8387-8cb5a71e51c5</CameraID>
<ExternalType>My event</ExternalType>
<Description>Something has happened</Description>
<FrameData>[BASE64IMAGE]</FrameData>
<Rect/>
</EventInfo>
Response example:
HTTP/1.1 200 OK
Description:
Allows you to generate an alarm or notification on the server. The body of the
request contains an EventInfo structure containing information about the event.
Parameters:
• ID – unique identifier of the event.
• Type – event type. Only the value “External” is supported.
• Level – alarm level (Notification/Alarm/Error).
• Time – time.
• TimeKind – time format – server local time or UTC. Supported values:
“Local”, “UTC”.
• CameraID – an unique identifier of the camera (can be empty if the event is not
associated with a camera).
• ExternalType – name of the event.
• Description – advanced event description.
• FrameData – attached Jpeg image in Base64 format (optional).
• Rect – coordinates of the object found on the image (optional).

12
17. Archive: Play Frame-by-frame (JPEG)
17.1. Initialize Session
Command:
/rsapi/archive/start?id=[CameraID]&time=[Time]&direction=[Direction
OfPlay]{&timeKind=local/utc}
Request example:
GET [Link]
4ca9-aaa0-abdeb09ea55d&time=2013-01-24T12:00:01&direction=Forward
Response example:
sessionid=250a21a1-ec9c-49d3-a761-f3d50e1a635e
Description:
To start playing the archive, open the playback session using this command.
Parameters:
• id – unique id of the camera in the system.
• time – start time of playback in the format 2013-01-24T12:00:01, or
2013/01/24T12:00:01.
• direction – direction of play. Available values: ‘Forward’ (default),
‘Backward’.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
Note:
If there is no access to the archive, the session closes automatically. Even if there
is a pause, you need to download either the current image (speed=0) or the current
time once a second.
17.2. Get Current/Next Video Frame
Command:
/rsapi/archive/snapshot?sessionid=[ARCHIVESESSIONID]&speed=[Speed]{
&viewSize=[width]x[height]}{&timeKind=local/utc}
Example:
GET
[Link]
572e-4ca9-aaa0-abdeb09ea55d&viewSize=320x240
Description:
Get the current or next video frame in JPEG format.
Parameters:
• sessionid – id of the archive playback session.
• speed – playback speed, from 0 to 64. If the speed is 0, the current frame will
be returned. Default: 1.
• viewSize – an optional parameter indicates the need to adjust the frame size to
the size of the specified viewport. Since the frame is compressed with a factor
that is a multiple of 2, the adjustment does not occur to the exact size of the
area. If this parameter is omitted, the command returns the frame in its original
resolution.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
17.3. Get Current Time
Command:
/rsapi/archive/time?sessionid=[ARCHIVESESSIONID]{&timeKind=local/ut
c}
Example:

13
GET [Link]
572e-4ca9-aaa0-abdeb09ea55d
Description:
Get the current time for a given archive playback session.
Parametes:
• sessionid – id of the archive playback session.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
17.4. Get Current Audio Frames
Command:
/rsapi/archive/audio?sessionid=[ARCHIVESESSIONID]&format=[FORMAT]
Example:
GET [Link]
572e-4ca9-aaa0-abdeb09ea55d?format=PCM
Description:
Get a list of audio frames that are actual at the time of playing a given session. The
format and parameters of the audio frames are specified in the header of each frame
in the Content-Type field.
Parameters:
• sessionid – id of the archive playback session.
• format – audio format. Available values: PCM, AAC.
17.5. Close Session
Command:
/rsapi/archive/stop?sessionid=[ARCHIVESESSIONID]
Archive:
GET [Link]
572e-4ca9-aaa0-abdeb09ea55d
Description:
Close the archive playback session.
Parameters:
• sessionid – id of the archive playback session.

18. Archive: Stream in Original Format


18.1. Initialize Session
Command:
/rsapi/archive/stream/init?id=[CameraID]&startTime=[StartTime]&stop
Time=[StopTime]&direction=[PlayDirection]&speed=[Speed]{&audioForma
t=[AudioFormat]}{&timeKind=local/utc}
Request example:
GET [Link]
c364-430e-9934-7dc458e98066&startTime=2013-01-
24T12:00:01&direction=Forward&speed=2&audioFormat=AAC
Server response example:
sessionid=250a21a1-ec9c-49d3-a761-f3d50e1a635e
Description:
Initializes an archive reading session without data transcoding. Server will response
with the identifier of the session, which can be used to get the actual data or to
pause or change the playback speed.
Parameters:
• id – unique id of the camera in the system.
• startTime – start time of playback in the format ‘2013-01-24T12:00:01’, or
‘2013/01/24T12:00:01’.
14
• stopTime – end time of playback in the format ‘2013-01-24T12:00:01’, or
‘2013/01/24T12:00:01’ (if not set, do not stop playback.). Instead of this
parameter, an alternative parameter "duration" can be used, which determines
the duration of the recording relative to startTime (example:
duration=00:00:45).
• direction – direction of play. Possible values: ‘Forward’ (default), ‘Backward’.
• speed - the playback speed, from 0 to 64. Default: 1. If zero speed is specified,
the video will be paused after the first frame is sent.
• audioFormat - audio format. Available values: PCM, AAC. The audio will not
be sent if the parameter is missing.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
18.2. Get Data Stream
Command:
/rsapi/archive/stream/get?sessionid=[SessionID]{&timeKind=local/utc
}
Example:
GET
[Link]
ec9c-49d3-a761-f3d50e1a635e
Description:
Starts video and audio streaming. The data is to be sent as a continuous sequence of
not-transcoded frames. The frame format is specified in a separate header of each
frame in the Content-Type field. One of the values below is possible. Additional
frame parameters are located after the semicolon and may vary depending on the
encoding settings. The AAC profile number is returned in the specificParam
variable.
Content-Type: image/jpeg
Content-Type: rsvid/h264; frametype=I
Content-Type: rsvid/h265; frametype=I
Content-Type: rsvid/mpeg4; frametype=I
Content-Type: PCM; sampleFrequency=44100; bitsPerSample=16;
numberOfChannels=1
Content-Type: AAC; bitrate=64000; sampleFrequency=32000;
numberOfChannels=1; specificParam=0;
When playback is paused or finished, the server will send a text packet describing
the stream state (“State=Paused” or “State=StreamEnd”):
--myboundary
Content-Type: text/html
Content-Length: 12

State=Paused
Parameters:
• sessionid – unique session identifier.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
18.3. Control Playback Speed
Command:
/rsapi/archive/stream/update?sessionid=[SessionID]&speed=[Speed]
Example: GET
[Link]
84e7fe06-b75d-4439-b988-744b9edd00b4&speed=2
Description:

15
This allows you to
change the speed of a stream requested via
/rsapi/archive/stream/get. When using a zero value for the speed, the
playback of the stream will be paused. To unpause, execute a request with a non-
zero speed.
Parameters:
• sessionid – unique session identifier.
• speed – the playback speed, from 0 (pause) to 64.
18.4. Close Session
Command:
/rsapi/archive/stream/stop?sessionid=[SessionID]
Example: GET [Link]
84e7fe06-b75d-4439-b988-744b9edd00b4
Description:
This allows you to stop the stream requested via /rsapi/archive/stream/get.
Parameters:
• sessionid – unique session identifier.

19. Archive: Stream Video (MJPEG)


Command:
/rsapi/archive/mjpeg?id=[CameraID]&startTime=[StartTime]&stopTime=[
StopTime]&direction=[PlayDirection]&speed=[Speed]{&viewSize=[width]
x[height]}{&audioFormat=[AudioFormat]}{&timeKind=local/utc}
Example:
GET [Link]
4ca9-aaa0-abdeb09ea55d&startTime=2013-01-
24T12:00:01&direction=Forward&speed=2&viewSize=320x240
Description:
Request an archive as a continuous sequence of JPEG frames.
Parameters:
• id – unique id of the camera in the system.
• startTime – start time of playback in the format ‘2013-01-24T12:00:01’, or
‘2013/01/24T12:00:01’.
• stopTime – end time of playback in the format ‘2013-01-24T12:00:01’, or
‘2013/01/24T12:00:01’ (if not set, do not stop playback.). Instead of this
parameter, an alternative parameter "duration" can be used, which determines
the duration of the recording relative to startTime (example:
duration=00:00:45).
• direction – direction of play. Possible values: ‘Forward’ (default), ‘Backward’.
• speed - the playback speed, from 0.20 to 64. Default: 1.
• viewSize – an optional parameter indicates the need to adjust the frame size to
the size of the specified viewport. Since the frame is compressed with a factor
that is a multiple of 2, the adjustment does not occur to the exact size of the
area. If this parameter is omitted, the command returns the frame in its original
resolution.
• audioFormat - audio format. Available values: PCM, AAC. The audio will not
be sent if the parameter is missing.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

20. Archive: List Records by Date


Command:

16
/rsapi/archive/sequences?id=[CameraID]&date=[Date]{&timeKind=local/
utc}
Example:
GET [Link]
d98a-4022-8799-6b150b699f7b&date=2017-09-21
Response example:
HTTP/1.1 200 OK
Content-Type: text/xml

Sequences>
<Sequence>
<RecordStart>2017-09-20T18:48:43.277</RecordStart>
<RecordEnd>2017-09-20T18:48:57.647</RecordEnd>
<DiskID>809141b8-15b1-44eb-962b-12e7d6259f69</DiskID>
<Reason>Motion</Reason>
<IsFinished>true</IsFinished>
</Sequence>
<Sequence>
<RecordStart>2017-09-20T18:49:01.603</RecordStart>
<RecordEnd>2017-09-20T18:49:21.757</RecordEnd>
<DiskID>809141b8-15b1-44eb-962b-12e7d6259f69</DiskID>
<Reason>Motion</Reason>
<IsFinished>true</IsFinished>
</Sequence>
.....
</Sequences>
Description:
Get a list of video sequences (records) for the specified camera for the specified
date.
Parameters:
• id – unique id of the camera in the system.
• date – date in format 2013-01-24, or 2013/01/24.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC. When ‘timeKind=UTC’ is specified, the ‘date’ parameter
needs to be replaced with ‘&timeFrom=[TimeFrom]&timeTo=[TimeTo]’.

21. Archive export


21.1. Initialize Session
Command:
/rsapi/archive/export/start?id=[CameraID]&startTime=[StartTime]&end
Time=[EndTime]{&timeKind=local/utc}
Example:
[Link]
40c4-adb8-28f59af19411&startTime=2022-05-27T15:00:00&endTime=2022-
05-27T15:10:00
Description:
Launches an export of a section of the camera archive to an MP4 file. Returns the
export session ID in response.
Parameters:
• id – unique id of the camera in the system.
• startTime – period start time and date.
• endTime – period end time and date.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.
Response example:
sessionId=04d1a4b0-c6af-40c4-adb8-28f59af19411

21.2. Check Export Status


Command:
/rsapi/archive/export/status
17
Example:
[Link]
c2-ea1f-422b-a1ea-dd7dab810de7
Description:
Returns: export state (possible values are: NotFound, Exporting, Error, Canceled,
Success), percent of progress and error status (if applicable).
Parameters:
• sessionId – identifier of the export session.
Response example:
status=Exporting; percent=50

21.3. Download Export File


Command:
/rsapi/archive/export/download
Example:
[Link]
8ec2-ea1f-422b-a1ea-dd7dab810de7
Description:
Downloads exported file contents.
Parameters:
• sessionId – identifier of the export session.
21.4. Cancel Export
Command:
/rsapi/archive/export/cancel
Example:
[Link]
c2-ea1f-422b-a1ea-dd7dab810de7
Description:
Allows to cancel an incomplete export.
Parameters:
• sessionId – identifier of the export session.

22. Archive: Get Single Frame


Command:
/rsapi/archive/exportsnapshot?id=[CameraId]&time=[Time]{&viewSize=[
width]x[height]}{&timeKind=local/utc}
Example:
GET
[Link]
c364-430e-9934-7dc458e98066&time=2024-04-06T10:00&viewSize=320x240
Description:
Getting a single current frame from the camera in JPEG format.
Parameters:
• id – unique id of the camera in the system.
• time – needed archive time.
• viewSize – an optional parameter that allows to resize the frame to the size of
the specified viewport. Since the frame is compressed with a factor that is a
multiple of 2, the adjustment does not occur to the exact size of the area. If this
parameter is omitted, the command returns the frame in its original resolution.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

18
23. Get Current User Permissions
Command:
/rsapi/configuration/users/roles/select
Example:
[Link]
Description:
Returns current user rights in XML format.
Response example:
<SecurityRoles>
<SecurityRole>
<ID>2435f711-e430-4b1f-8d32-a05936524588</ID>
<Name>Administration</Name>
</SecurityRole>

<SecurityRole>
<ID>70343d0b-6079-4c77-bc45-6902422bc18a</ID>
<Name>WebArchiveExport</Name>
</SecurityRole>
</SecurityRoles>

24. Get Cameras


Command:
/rsapi/configuration/cameras
Example:
[Link]
Description:
Returns an XML document with a list of cameras.
Response example:
<Cameras>
<Camera>
<ID>9436d3e1-0410-4cc1-8383-c88099a9d3f7</ID>
<Name>AXIS 211 - 00408C93666B - [Link]</Name>
<Description/>
<Address>[Link]</Address>
<Port>80</Port>
<RtspPort>554</RtspPort>
<RtspUseUdp>false</RtspUseUdp>
<User>root</User>
<Password>admin</Password>
<CameraNumber>0</CameraNumber>
<ModelID>ef740a24-2f84-4f49-b481-009693b66514</ModelID>
<RecProfileID>b9884849-dfab-44fa-94d8-c42d68b70365</RecProfileID>
<ReceiveAudio>true</ReceiveAudio>
<Disabled>true</Disabled>
<UseIntelDecoder>false</UseIntelDecoder>
<ClientUseDXVA>false</ClientUseDXVA>
<ExternalAudioUrl>dshow://2</ExternalAudioUrl>
<ArchiveMinStorageHours>0</ArchiveMinStorageHours>
<ArchiveMaxStorageHours>0</ArchiveMaxStorageHours>
<BaseSource>
<Resolution/>
<Compression>Default</Compression>
<Fps>0</Fps>
<Protocol>Rtsp</Protocol>
<UrlParams/>
</BaseSource>
<SecoundSource/>
</Camera>
</Cameras>

25. Get Layouts


Command:
/rsapi/configuration/viewprofiles
Example:
GET [Link]
Description:

19
Returns an XML document with a list of display profiles (layouts) of the authorized
user.
Response example:
<ViewProfiles>
<ViewProfile>
<ID>ea7b4be3-25ff-4ca3-aff2-473020066baa</ID>
<Name>Profile 1 (1 x 1)</Name>
<RowCount>1</RowCount>
<ColumnCount>1</ColumnCount>
<Cells>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
</Cells>
</ViewProfile>
<ViewProfile>
<ID>799fa59f-23d2-4b55-a99b-4fcbe879ab02</ID>
<Name>Profile 3 (5 + 1)</Name>
<RowCount>3</RowCount>
<ColumnCount>3</ColumnCount>
<Cells>
<Cell>
<ColSpan>2</ColSpan>
<RowSpan>2</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
</Cells>
</ViewProfile>
</ViewProfiles>

26. Get Shared Layouts


Command:
/rsapi/configuration/sharedviewprofiles
Example:
GET [Link]
Description:
Returns an XML document with a list of shared display profiles (layouts) of the
authorized user.
Response example:
20
<ViewProfiles>
<ViewProfile>
<ID>ea7b4be3-25ff-4ca3-aff2-473020066baa</ID>
<Name>Profile 1 (1 x 1)</Name>
<RowCount>1</RowCount>
<ColumnCount>1</ColumnCount>
<Cells>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
</Cells>
</ViewProfile>
<ViewProfile>
<ID>799fa59f-23d2-4b55-a99b-4fcbe879ab02</ID>
<Name>Profile 3 (5 + 1)</Name>
<RowCount>3</RowCount>
<ColumnCount>3</ColumnCount>
<Cells>
<Cell>
<ColSpan>2</ColSpan>
<RowSpan>2</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
<Cell>
<ColSpan>1</ColSpan>
<RowSpan>1</RowSpan>
<CameraID>00000000-0000-0000-0000-000000000000</CameraID>
<SourceSwitchWidth>640</SourceSwitchWidth>
</Cell>
</Cells>
</ViewProfile>
</ViewProfiles>

27. Get Recording Profiles


Command:
/rsapi/configuration/recprofiles
Example:
GET [Link]
Description:
Returns an XML document with a list of record profiles.
Response example:
<RecProfiles>
<RecProfile>
<ID>b9884849-dfab-44fa-94d8-c42d68b70365</ID>
<Name>Record by motion detector</Name>
<Description/>
<Lines>

21
<Line>
<Days>127</Days>
<StartTime>00:00:00</StartTime>
<EndTime>00:00:00</EndTime>
<BaseSource>true</BaseSource>
<Fps>60</Fps>
<Type>Motion</Type>
<PreTime>5</PreTime>
<PostTime>10</PostTime>
</Line>
</Lines>
</RecProfile>
</RecProfiles>

28. Get Disks


Command:
/rsapi/configuration/disks
Example:
[Link]
Description:
Returns an XML document with a list of disks registered in the system.
Response example:
<Disks>
<Disk>
<ID>e2170d0a-7979-4dd2-be69-732ae703550e</ID>
<Name>D:\</Name>
<Description/>
<Disabled>false</Disabled>
<Quota>0</Quota>
</Disk>
</Disks>

29. Get User Actions


Command:
/rsapi/configuration/useractions
Example:
GET [Link]
Description:
Returns an XML document with a list of user actions.
Response example:
<UserActions>
<UserAction>
<ID>ccf157b2-b6a6-4235-a369-04d1c8b98cf9</ID>
<Name>Action1</Name>
<Description/>
<Disabled>false</Disabled>
</UserAction>
</UserActions>

30. Execute User Action


Command:
/rsapi/configuration/useractions/execute
Example: GET
[Link]
ccf157b2-b6a6-4235-a369-04d1c8b98cf9
Description:
Starts the specified user action.
Parameters:
• id – unique identifier of an action in the system.

31. Get Basic Configuration


Command: /rsapi/configuration/appconfig
Description:
22
Returns basic app configuration (contents of the ‘config/[Link]’ file).
Request example:
POST [Link]
Response example:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<configuration>
<appSettings>
<!-- Common variables. -->
<add key="Port" value="11011"/>
<add key="InterfaceLanguage" value="English"/>
<add key="PreferFFmpegVideoDecoder" value="yes"/>
<add key="PreferFFmpegAudioDecoder" value="yes"/>
<!-- Server variables. -->
<add key="HttpPort" value="11012"/>
<add key="HttpSourceSwitchWidth" value="640"/>
<add key="HttpsPort" value=""/>
<add key="HttpsCertificate" value=""/>
<add key="RtspPort" value=""/>
<add key="BindTo" value="Dns"/>
<add key="CreateFirewallRules" value="yes"/>
<add key="SkipBrokenJpegOverRtspFrames" value="no"/>
<add key="SkipBrokenH264OverRtspSequences" value="no"/>
<add key="EnableArchiveRecompression" value="yes"/>
<add key="MobileHighResolution" value="800x480"/>
<add key="MobileHighFps" value="15"/>
<add key="MobileMediumResolution" value="320x240"/>
<add key="MobileMediumFps" value="5"/>
<!-- Client variables. -->
<add key="DisableScreenSaver" value="yes"/>
</appSettings>
</configuration>

32. Get RDC RFID Events


Command:
/rsapi/modules/rdc_rfid
Example:
GET [Link]
Description:
Function called by the RDC RFID system to transmit an event to the server.

33. Check Video Analytics Module Availability


Command:
/rsapi/modules/getcanaccessmodule?moduleId=[moduleID]
Example:
GET
[Link]
12F7CDA9-EC68-4FA0-A14F-F1C86E22088C
Description:
This function allows you to check whether the specified analytics module is
installed and whether the current user has the rights to work with it.
Parameters:
• moduleId – unique module ID, 12F7CDA9-EC68-4FA0-A14F-
F1C86E22088C for Sagitech LPR, or EE272D1D-B29A-4EA3-84EB-
6E62B45519AB for Sagitech FR.

34. People Counter Module


34.1. Get Status
Command:
/rsapi/modules/counter/getstats
Description:
23
Returns an XML document containing information on the status of the people
counter module on all cameras.
Request example:
GET [Link]
Response example:
<CameraStates>
<CameraState>
<CameraID>2771ed81-dddc-42ed-af3f-b04a4b478b1c</CameraID>
<LastResetTime>2020-03-20T11:50:26.591</LastResetTime>
<In>20</In>
<Out>10</Out>
</CameraState>
<CameraState>
<CameraID>a10c06b5-3399-44be-934b-49e0bda892c7</CameraID>
<LastResetTime>2020-03-20T11:50:26.591</LastResetTime>
<In>15</In>
<Out>12</Out>
</CameraState>
</CameraStates>

34.2. Reset Status


Command: /rsapi/modules/counter/reset
Request example:
GET [Link]
Description:
Resets the status of the people counter module on all cameras.

35. Queue Detection Module: Get Status


Command:
/rsapi/modules/queue/getstats
Description:
Returns an XML document containing information on the status of queue detection
modules on all cameras.
Request example:
GET [Link]
Response example:
<CameraStates>
<CameraState>
<CameraID>1998454d-ac0b-4437-8a05-a679a8863805</CameraID>
<ZoneStates>
<ZoneState>
<ZoneIndex>1</ZoneIndex>
<QueueLength>4</QueueLength>
<IsQueue>false</IsQueue>
</ZoneState>
<ZoneState>
<ZoneIndex>2</ZoneIndex>
<QueueLength>4</QueueLength>
<IsQueue>false</IsQueue>
</ZoneState>
</ZoneStates>
</CameraState>
</CameraStates>

36. Heatmap Module: Generate Heatmap Image


Command: /rsapi/modules/heatmap/build?id=[CameraID]&
timeFrom=[TimeIntervalStart]&timeTo=[TimeIntervalEnd]
{&weekDays=[DaysOfTheWeek]}{&dayStartTime=[DayIntervalStart]}{&dayE
ndTime=[DayIntervalEnd]}{&opacity=[HeatmapOpacity]}
{&timeKind=local/utc}
Request example:
GET [Link]
79a5-449d-b888-daa317035a2e&timeFrom=2025-08-27T10:00&timeTo=2025-
08-

24
27T18:00&weekDays=Monday,Tuesday,Wednesday&dayStartTime=08:00&dayEn
dTime=18:00&opacity=0.75&timekind=utc
Description:
Creates a heat map for a given camera over a given time period. The request returns
a JPEG image.
Parameters:
• id – unique camera identifier in the system.
• timeFrom – the beginning of the time interval for which data is loaded.
• timeTo – the end of the time interval for which data is loaded.
• weekDays – optional parameter, specifies the days of the week for which data
should be downloaded. Commas separate values. Possible values: All (default -
all days of the week), Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday, Sunday.
• dayStartTime – optional parameter, the start of a daily time interval (e.g. the
start of a workday).
• dayEndTime - optional parameter, the end of a daily time interval (e.g. the end
of a workday).
• opacity – optional parameter, transparency of the heatmap when overlaid on
top of the current frame. Possible values: from 0.1 to 0.9. Default value: 0.5.
• timeKind – an optional parameter that specifies time format to use – server
local time or UTC.

37. License Plate Recognition Module


37.1. Manage Cards
Command:
/rsapi/modules/lpr/owners
Description:
Allows you to interact with the card database of the license plate recognition
module with the REST API.
Note:
For the GET, POST, PUT, DELETE commands, you can specify the card ID in the
URL. In the case of GET, this allows you to select only one card from the list. For
the rest of the commands, this is left for compatibility and is optional. Example:
GET [Link]
816c-e13aca2944b4.
Options:
• GET – get a list or a single item.
Request:
GET [Link]
Response:
<LPROwners>
<LPROwner>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas</FirstName>
<FamilyName></FamilyName>
<MiddleName/>
<Plate>7463JMF</Plate>
<Model/>
<VinCode/>
<WorkPlace/>
<Position/>
<Phone/>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Pass>
<ID>90e0b1f4-fca3-4d74-92cc-8e9ead07df8a</ID>

25
<PeriodStartTime/>
<PeriodEndTime/>
<DayStartTime>08:00:00</DayStartTime>
<DayEndTime>20:00:00</DayEndTime>
<Days>All</Days>
<MaxPassages>0</MaxPassages>
<MaxInsideSameGroup>0</MaxInsideSameGroup>
<Description/>
</Pass>
</LPROwner>
</LPROwners>
• POST – add a card.
Request:
POST [Link]
<LPROwner>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas/FirstName>
<FamilyName>Andreas</FamilyName>
<MiddleName/>
<Plate>7463JMF</Plate>
<Model/>
<VinCode/>
<WorkPlace/>
<Position/>
<Phone/>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Pass>
<ID>90e0b1f4-fca3-4d74-92cc-8e9ead07df8a</ID>
<PeriodStartTime/>
<PeriodEndTime/>
<DayStartTime>08:00:00</DayStartTime>
<DayEndTime>20:00:00</DayEndTime>
<Days>All</Days>
<MaxPassages>0</MaxPassages>
<MaxInsideSameGroup>0</MaxInsideSameGroup>
<Description/>
</Pass>
</LPROwner>
• PUT – edit a card.
Request:
PUT [Link]
<LPROwner>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas</FirstName>
<FamilyName></FamilyName>
<MiddleName/>
<Plate>7463JMF</Plate>
<Model/>
<VinCode/>
<WorkPlace/>
<Position/>
<Phone/>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Pass/>
</LPROwner>
• DELETE – delete a card.
Request type 1 (with the id in the request body):
DELETE [Link]
<LPROwnerId>5925d527-48c6-4b67-816c-e13aca2944b4</LPROwnerId>
Request type 2 (with the id in the URL):
DELETE [Link]
48c6-4b67-816c-e13aca2944b4

26
37.2. Manage Groups
Command:
/rsapi/modules/lpr/groups
Description:
Allows you to interact with groups of the license plate recognition module with the
REST API. Supported HTTP commands:
• GET – getting a list or an individual item;
• POST – adding group;
• PUT – editing group;
• DELETE – delete group.
Note:
For the commands GET, POST, PUT, DELETE you can specify the card ID in the
URL. In the case of GET, this allows you to select only one group from the list.
For the rest of the commands, this is left for compatibility and is optional.
Example: GET
[Link]
816c-e13aca2944b4.
Request example:
GET [Link]
Response example on GET request:
<LPRGroups>
<LPRGroup>
<ID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</ID>
<Name>White</Name>
<Color>FFFFFFFF</Color>
</LPRGroup>
<LPRGroup>
<ID>8a41c537-c50f-497e-a05e-a0347f4de893</ID>
<Name>Control</Name>
<Color>FFFF8080</Color>
</LPRGroup>
<LPRGroup>
<ID>efe05502-591c-473f-a07e-7586b65a707b</ID>
<Name>Black</Name>
<Color>FF000000</Color>
</LPRGroup>
</LPRGroups>

37.3. Get Parking Information


Command:
/rsapi/modules/lpr/parkinginfo
Description:
Returns information about cars in the parking area. Also returns the size of the
parking lot (the number of parking spaces specified in the configuration file
[Link]).
Request example:
GET [Link]
Response example:
<ParkingInfo>
<ParkingSize>100</ParkingSize>
<LPRInsideInfos>
<LPRInsideInfo>
<ID>4627daf4-1700-4607-a6ec-bc000e8e274d</ID>
<Plate>7463JMF</Plate>
<EntranceTime>12.07.2023 23:54:06</EntranceTime>
<CameraID>4ddf26b5-1241-4b8b-84a8-50fa06624c36</CameraID>
</LPRInsideInfo>
<LPRInsideInfo>
<ID>095ccca5-24c4-420e-a7f2-b81aba6a2200</ID>
<Plate>2513KLF</Plate>
<EntranceTime>12.07.2023 23:54:18</EntranceTime>
<CameraID>4ddf26b5-1241-4b8b-84a8-50fa06624c36</CameraID>
</LPRInsideInfo>
</LPRInsideInfos>

27
</ParkingInfo>

38. Face Recognition Module


38.1. Manage Cards
Command:
/rsapi/modules/fr/persons
Description:
Allows you to interact with the card file of the face recognition module with the
REST API.
Note:
For the commands GET, POST, PUT, DELETE you can specify the card ID in the
URL. In the case of GET, this allows you to get only one card from the list. For the
rest of the commands, this is left for compatibility and is optional. Example: GET
[Link]
e13aca2944b4.
Options:
• GET - getting a list or an individual item. Specify the ‘sendphotos’ flag to receive
the photos linked to the card.
Request:
GET
[Link]
Response:
<FRPersons>
<FRPerson>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas</FirstName>
<FamilyName></FamilyName>
<MiddleName/>
<WorkPlace/>
<Position/>
<Phone/>
<CardNumber>110</CardNumber>
<CardVersion>0</CardVersion>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Photos>
<Photo>[BASE64IMAGE]</Photo>
</Photos>
</FRPerson>
</FRPersons>
• POST – add a card.
Note: the Photos block is optional.
Request:
POST [Link]
<FRPerson>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas</FirstName>
<FamilyName></FamilyName>
<MiddleName/>
<WorkPlace/>
<Position/>
<Phone/>
<CardNumber>110</CardNumber>
<CardVersion>0</CardVersion>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Photos>
<Photo>[BASE64IMAGE]</Photo>
</Photos>
</FRPerson>
• PUT – edit a card.
28
Note: the Photos block is optional.
Request:
PUT [Link]
<FRPerson>
<ID>5925d527-48c6-4b67-816c-e13aca2944b4</ID>
<FirstName>Andreas</FirstName>
<FamilyName></FamilyName>
<MiddleName/>
<WorkPlace/>
<Position/>
<Phone/>
<CardNumber>110</CardNumber>
<CardVersion>0</CardVersion>
<Description/>
<GroupIDs>
<GroupID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</GroupID>
</GroupIDs>
<Photos>
<Photo>[BASE64IMAGE]</Photo>
</Photos>
</FRPerson>
• DELETE – delete a card.
Request, type 1 (with the id in the request body):
DELETE [Link]
<FRPersonId>5925d527-48c6-4b67-816c-e13aca2944b4</FRPersonId>
Requwst, type 2 (with the id in the URL):
DELETE [Link]
5925d527-48c6-4b67-816c-e13aca2944b4

38.2. Manage Groups


Command:
/rsapi/modules/fr/groups
Description:
Allows you to interact with groups of the face recognition module with the REST
API. Supported HTTP commands:
• GET – getting a list or an individual item;
• POST – adding group;
• PUT – editing group;
• DELETE – deleting group.
Note:
For the commands GET, POST, PUT, DELETE you can specify the card ID in the
URL. In the case of GET, this allows you to get only one group from the list. For
the rest of the commands, this is left for compatibility and is optional. Example:
GET [Link]
816c-e13aca2944b4.
Example:
GET [Link]
Response example on GET request:
<FRGroups>
<FRGroup>
<ID>bb31b7a0-4421-40cf-abb4-9f5b86b4dd07</ID>
<Name>White</Name>
<Color>FFFFFFFF</Color>
</FRGroup>
<FRGroup>
<ID>8a41c537-c50f-497e-a05e-a0347f4de893</ID>
<Name>Control</Name>
<Color>FFFF8080</Color>
</FRGroup>
<FRGroup>
<ID>efe05502-591c-473f-a07e-7586b65a707b</ID>
<Name>Black</Name>
<Color>FF000000</Color>
</FRGroup>
</FRGroups>
29
38.3. Verify by ACS Card Number
Command:
/rsapi/modules/fr/checkpresence
Description:
Allows you to check that a face in front of the camera matches the specified card.
Reconciliation is performed by the ACS card number passed in the body of the
POST request. The camera identifier should be specified with the ‘CameraID’
parameter. The response contains a set of four variables:
▪ Result – result type. Available values: MatchPositive (the face is
uniquely matched), NoCardInDB (the card with the specified ID was
not found in the database), NoPhotoInCard (the card with the specified
ID was found, but the photo is not linked to the card), NoFaceDetected
(the face was not detected in the video stream), MatchNegative (the
face is not matched to any face in the database), MatchIncorrect (the
face is matched to another face in the DB).
▪ ResultCode – digital representation of the result type. Available
values: 0 (MatchPositive), 1 (NoCardInDB), 2 (NoPhotoInCard), 3
(NoFaceDetected), 4 (MatchNegative), 5 (MatchIncorrect).
▪ MatchFactor – the accuracy with which the face is matched.
▪ MatchCardNumber – the number of the ACS card that the person is
associated with.
Request example:
POST [Link]

CameraID={1B8E4CB5-FCDF-4FC3-A45C-F21065CFEE71}
CardNumber=110
Response example:
Result=MatchPositive
ResultCode=0
MatchFactor=99
MatchCardNumber=110

38.4. Verify by Photo


Command:
/rsapi/modules/fr/checkfacepresence
Description:
Allows to check that the face in front of the camera lens matches the face in the
photo transmitted in the request. The image is encoded in Base64 and passed in the
body of the POST request in the text format: "ImageData=[Base64Image]". The
camera identifier should be specified with the ‘CameraID’ parameter. The response
contains aset of four variables:
▪ Result – result type. Available values: MatchPositive (the face is
uniquely matched), NoFaceDetected (the face was not detected in the
video stream), MatchNegative (the face in front of the camera lens
does not match the face in the transmitted image).
▪ ResultCode – digital representation of the result type. Available
values: 0 (MatchPositive), 3 (NoFaceDetected), 4 (MatchNegative).
▪ MatchFactor – the accuracy with which the face is matched..
Request example:
POST [Link]

CameraID={1B8E4CB5-FCDF-4FC3-A45C-F21065CFEE71}
ImageData=[Base64Image]
Response example:
Result=MatchPositive
ResultCode=0
MatchFactor=99

30
38.5. Control Recognition from External System
Command:
/rsapi/modules/fr/ondemand
Description:
Allows you to perform face recognition in front of the camera lens. It is used when
the "Recognition on demand" mode is selected in the module settings (in this mode,
the module analyzes faces in front of the lens only on an external command, and
spends the rest of the time waiting).
The ‘RequestID’ variable contains a unique request identifier and can be passed in
any format. The ‘Timeout’ variable specifies a face search timeout in milliseconds.
The ‘CameraID’ variable contains unique camera identifier. The command
terminates immediately without returning the recognition result, but the passed
request ID is bound to the face recognition event and can be obtained both with
scripts or with the event subscription command from the server.
Request example:
POST [Link]

CameraID={1B8E4CB5-FCDF-4FC3-A45C-F21065CFEE71}
RequestID=123-ABC
Timeout=10000

38.6. Subscribe to Events


Command:
/rsapi/modules/fr/events?format=[Format]
Request example 1:
GET [Link]
Response example 1:
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace;boundary=--myboundary

--myboundary
Content-Type: text/plain

level=Notification;type=FaceRecognition;cameraId=a3300d2c-4771-4fcc-b31d-
fe0085fc4712;eventId=cf647529-372a-455a-9129-175b758f4dfc;time=2020-04-
14T17:34:00.140;personId=9515ac2c-e34d-4b2a-a051-
35fbea17efe2;recognized=true;passage=None;realtime=2020-04-
14T17:33:59.363;state=unknown;requestId=;factor=99.33;cardNumber="101"
--myboundary
Content-Type: text/plain

Request example 2:
GET [Link]
Response example 2:
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace;boundary=--myboundary

--myboundary
Content-Type: application/json

{
"level": "Notification",
"type": "FaceRecognition",
"cameraId": "a3300d2c-4771-4fcc-b31d-fe0085fc4712",
"eventId": "20b175af-7741-493b-af08-796818682614",
"time": "2020-04-14T17:24:19.452",
"personId": "946d5717-e2c7-4f7b-b85b-da6361d4bf53",
"recognized": "true",
"passage": "None",
"realtime": "2020-04-14T17:24:19.024",
"state": "unknown",
"requestId": "",
"factor": 99.0,
"cardNumber": "111"
}
--myboundary

31
Content-Type: application/json

Description:
Returns real-time events from the face recognition module.
Parameters:
• format – formatting option. Available values: plain (default), json.
38.7. Search Archived Events
Command:
/rsapi/modules/fr/events?format=[Format]
Request example:
GET
/rsapi/modules/fr/searchevents?{timeFrom=...}{&timeTo=...}{&levels=
...}{&cameraIds=...}{&lastMinutes=...}{&timeKind=local|utc}{&sendFa
ces=true|false}{&personFullName=...}{&personDescription=...}{&isRec
ognized=true|false}{&passage=None|Entrance|Exit}{&gender=Unknown|Fe
male|Male}{&mask=Unknown|Detected|NotDetected}{&state=...}{&groupId
s=...}{&fromAge=...}{&toAge=...}{&extendedValue=...}
Response example:
HTTP/1.1 200 OK
Content-Type: text/xml

<?xml version="1.0" encoding="utf-8" standalone="yes"?>


<Items>
<Item>
<EventID>84796b4b-cf94-48dc-890d-3802f2ba7c05</EventID>
<HostID>35e3e8df-55c4-4803-83ab-1682a48ca5a6</HostID>
<Time>2025-08-27T16:13:16.043</Time>
<CameraID>3e1c9b57-b02d-46d8-a144-200d72fb08f3</CameraID>
<CameraName>FR</CameraName>
<PersonID>b31f5929-fe27-49bf-b138-7ddc14fb262b</PersonID>
<PersonName>Test Person</PersonName>
<GroupNames></GroupNames>
<Description></Description>
<WorkPlace></WorkPlace>
<Position></Position>
<CardNumber></CardNumber>
<IsRecognized>True</IsRecognized>
<State>Unknown</State>
<StateString>Unknown</StateString>
<Factor>0</Factor>
<Passage>None</Passage>
<Age>0</Age>
<Gender>Unknown</Gender>
<GenderString>Unknown</GenderString>
<Ethnicity>Unknown</Ethnicity>
<EthnicityString>Unknown</EthnicityString>
<Mask>Unknown</Mask>
<MaskString>Unknown</MaskString>
<Temperature>0</Temperature>
<LivenessFactor />
<Level>Notification</Level>
<LevelString>Information</LevelString>
<Rect>
<X>48.75</X>
<Y>53.125</Y>
<Width>11.71875</Width>
<Height>16.666666</Height>
</Rect>
<FaceJpegData />
</Item>
</Items>
Description:
Returns a list of Face Recognition module events from the archive, filtered by the
specified criteria.
Parameters:
• timeFrom — start of the time range. Omit if lastMinutes is provided.
• timeTo — end of the time range. Omit if lastMinutes is provided.
• levels — optional, comma-separated list of event severity levels.
32
• cameraIds — optional, comma-separated list of camera IDs.
• lastMinutes — optional alternative to timeFrom/timeTo: number of minutes
back from “now” to load data for.
• timeKind — optional, time interpretation: local (server local time) or utc.
• sendFaces — optional, whether to include face images in the response: true or
false.
• personFullName — optional, filter by employee/person full name.
• personDescription — optional, filter by employee/person description.
• isRecognized — optional, filter by recognition status: true or false.
• passage — optional, passage direction filter: None, Entrance, Exit.
• gender — optional, gender filter: Unknown, Female, Male.
• mask — optional, mask presence filter: Unknown, Detected, NotDetected.
• state — optional, event state filter:
Unknown, Draft, ReEntrance, Duplicate, MatchPositive, MatchIncorrect,
MatchNegative, PPEApproved, PPERejected, PPETimeout, Edited.
• groupIds — optional, comma-separated list of group IDs.
• fromAge — optional, lower bound for estimated age.
• toAge — optional, upper bound for estimated age.
• extendedValue — optional, filter by the value of an additional/extended field.

38.8. Analytics: Get Status


Command:
/rsapi/modules/fr/analytics/getstats
Description:
Returns an XML document containing information on the status of people analytics
on all cameras.
Request example:
GET [Link]
Response example:
<CameraStates>
<CameraState>
<CameraID>2771ed81-dddc-42ed-af3f-b04a4b478b1c</CameraID>
<LastResetTime>2020-03-20T11:50:26.591</LastResetTime>
<In>20</In>
<Out>10</Out>
</CameraState>
<CameraState>
<CameraID>a10c06b5-3399-44be-934b-49e0bda892c7</CameraID>
<LastResetTime>2020-03-20T11:50:26.591</LastResetTime>
<In>15</In>
<Out>12</Out>
</CameraState>
</CameraStates>

38.9. Analytics: Reset Status


Command: /rsapi/modules/fr/analytics/reset
Request example:
GET [Link]
Description:
Resets the status of people analytics on all cameras.

33

Common questions

Powered by AI

Managing streaming sessions poses challenges such as ensuring seamless playback, handling session interruptions, and maintaining resource efficiency. The system addresses these challenges by providing control commands like '/rsapi/archive/stream/get' for initiating the stream and '/rsapi/archive/stream/stop' for properly closing sessions . The command '/rsapi/archive/stream/update' allows for real-time control of playback speed and state (pause/resume), ensuring smooth playback synchronization and reducing delays . Additionally, the server sends status packets indicating 'State=Paused' or 'State=StreamEnd', facilitating monitoring and enabling corrective measures in case of interruptions . These functionalities ensure robust session management by aligning with user control and operational efficiency.

The archive streaming session allows flexibility in video playback and control through several commands. The '/rsapi/archive/stream/init' command initializes the session specifying parameters such as playback speed and direction (forward or backward), and can include audio format if desired . The playback speed can later be adjusted using '/rsapi/archive/stream/update' to change or pause the playback by setting speed to zero . Additionally, the session can be closed with '/rsapi/archive/stream/stop', which stops the stream initiated . All these controls ensure that the user can manage how and when the content is viewed during a streaming session.

Commands for session control ensure proper initiation and termination of archive sessions by using specific start and stop commands with clear parameters. The '/rsapi/archive/start' command initializes a session by using identifiers like CameraID and time parameters, enabling precise commencement of playback . For proper termination, the '/rsapi/archive/stop' command is used, with the 'sessionid' parameter ensuring closure of the exact session without affecting other active sessions . These commands enforce session integrity by clearly marking session boundaries and facilitating orderly data management through defined start and stop procedures.

The 'sessionid' serves a crucial role in video and audio data retrieval by acting as a unique identifier for each archive playback or streaming session . It is vital for associating all retrieval commands to the correct session, ensuring that each operation such as fetching video frames ('/rsapi/archive/snapshot') or current audio frames ('/rsapi/archive/audio') targets the specific, ongoing archive session . This identifier maintains session integrity, preventing overlaps or mismatches in data retrieval, and allows modifications like adjusting playback speed or stopping the stream to be precisely executed on the intended session . Therefore, 'sessionid' is indispensable for accurate and reliable data management.

The use of optional parameters such as 'timeKind' significantly influences the functionality and usability of archive querying commands by providing flexibility in time format specification. This parameter allows command users to decide whether to use server local time or Coordinated Universal Time (UTC), which is crucial for systems functioning across different time zones or in environments where uniform time representation is critical . By accommodating both time formats, 'timeKind' enhances precision in data retrieval and interaction with archived data. This, in turn, improves usability by ensuring accurate time references and reducing potential time-related errors in scheduling or event logging .

Key parameters involved in managing video frame retrieval during archive playback include session ID, speed, and view size. The session ID uniquely identifies the playback session . The speed parameter controls the playback speed, ranging from 0 (for pausing) to 64, with the default speed being 1. If the speed is set to 0, the current frame will be returned, which allows the retrieval of specific frames for analysis . Additionally, the viewSize parameter permits adjustment of the frame size, although the compression occurs in multiples of 2, indicating some flexibility in viewing preferences . These parameters collectively enable detailed control over frame retrieval during playback.

The choice between different audio formats like PCM and AAC in archive streaming has significant implications for playback. PCM is a lossless format that may ensure better audio quality at the cost of higher bandwidth and storage usage, making it suitable for high-fidelity needs . On the other hand, AAC is a lossy format, optimized for efficient compression, which reduces file sizes and bandwidth demand while maintaining acceptable audio quality . This choice affects playback by influencing how audio is delivered and experienced, with considerations depending on the user's network stability, server capacity, and quality requirements. This flexibility allows the system to cater to varying end-user requirements and system constraints.

The system ensures continuity and precision when streaming video in its original format by initializing a stream session with specified start and stop times, playback speed, and direction without data transcoding . This is achieved using the '/rsapi/archive/stream/init' command, which allows setting a time range for playback, ensuring precision in selecting specific video intervals . Once initialized, the system streams data continuously with headers indicating frame formats and encoding specificity, such as AAC profiles or JPEG image formats . The presence of state messages like 'State=Paused' and 'State=StreamEnd' helps manage continuity by communicating the stream's status, thus maintaining precise control during streaming . These mechanics enable uninterrupted and precise video streaming for user-defined time intervals.

Adjusting the 'viewSize' parameter during video playback is advantageous in scenarios requiring the examination of video in specific resolutions, particularly when the display device has limited resolution or in cases where bandwidth conservation is necessary . By setting 'viewSize', users ensure that the video fits the viewport, thus enhancing viewing experience and potentially optimizing data usage . However, limitations exist as the frame is compressed by a factor that is a multiple of 2, meaning the frame size may not match the exact specified dimensions, thereby restricting precision in resizing . This limitation requires users to accommodate frames that are close but not exact to the desired size.

The license plate recognition (LPR) module's card management enhances data handling capabilities by allowing the addition, modification, retrieval, and deletion of cards through a REST API . Each card can contain relevant vehicle details such as license plate number, entry time, and association with specific groups or access conditions . These operations (GET, POST, PUT, DELETE) can be done by specifying the card ID, making data access and alteration both robust and precise . This flexibility ensures that the system can provide up-to-date and accurate information for each recognized vehicle, facilitating better resource allocation and security management.

You might also like