GET http://IPaddress:port/prefix/archive/contents/intervals/{VIDEOSOURCEID}/{ENDTIME}/{BEGINTIME} – get archive contents starting at BEGINTIME and ending at ENDTIME.
If BEGINTIME is not specified, infinite future is considered. If ENDTIME is not specified too, infinite past is considered. The words "past" and "future" can be used to set infinite past and infinite future as well.
Interval sequence corresponds to the ratio between specified BEGINTIME and ENDTIME (in ascending order if BEGINTIME<ENDTIME, and in descending order if ENDTIME<BEGINTIME). Start and end points of interval are returned in its common order, i.e. the interval start time is less than the interval end time or equal to it.
Set time in the YYYYMMDDTHHMMSSformat in the timezone UTC+0.
Parameter
Required
Description
limit
No
The number of intervals in the response, the default value is 100.
scale
No
The minimum time separation between two intervals at which they will be treated as two different intervals (not merged), the default value is 0.
archive
No
The name of the archive from which the intervals are to be retrieved. If not specified, the intervals are retrieved from the default archive.
true – the server did not return all intervals because the limit was exceeded (limit parameter).
false – the server returned all intervals from the specified time interval.
Get info about archive
Archive depth
GET http://IP Address:port/prefix/archive/statistics/depth/{VIDEOSOURCEID}/{ENDTIME}/{BEGINTIME} – to get the information about the archive depth starting at BEGINTIME and ending at ENDTIME.
GET http://IPAddress:port/prefix/archive/statistics/capacity/{VIDEOSOURCEID}/{ENDTIME}/{BEGINTIME} – to get the information about the recording capacity to specific camera archive starting at BEGINTIME and ending at ENDTIME.
Parameter
Required
Description
archive
No
The name of the archive from the request to get the list of the archives (see Get archive contents).
{STARTTIME} − time in ISO format. Set the timezone to UTC+0.
Parameter
Required
Description
speed
No
Playback speed, values can be negative.
format
No
Parameter values are 'mjpeg', 'rtsp', 'mp4', 'hls'. If the format is not specified, 'rtsp' is selected or it is not recognized, then the native format is selected by server to prevent additional encoding. If the native format is not supported by client, server selects WebM.
id
No
Unique identifier of archive stream (optional). It is used to get stream info or control the stream.
w
h
No
w – frame width, h – frame height.
fr
No
fps.
Important!
This parameter is relevant only for MJPEG video.
enable_token_auth
No
Get signed links to video streams.
enable_token_auth − enable authorization by token = 1.
valid_token_hours − signature validation time (in hours). The maximum value is a week. The default value is 12 hours.
valid_token_hours
No
Sample request:
GET http://127.0.0.1:80/archive/media/Server1/DeviceIpint.1/SourceEndpoint.video:0:0/20110608T060141.375?format=rtsp&speed=1&w=640&h=480&enable_token_auth=1&valid_token_hours=1
Important!
HLS archive video becomes available in 30 seconds after getting the response.
Results offset by the specified number. For example, if a query with offset=0 returned 100 results, then in order to get the next results, it is necessary to run a query with offset=100. If the second query returned 250 results, then in order to get the next results, it is necessary to run a query with offset=350, etc.
limit
No
Received bookmarks limit. The default value is 100.
Sample request:
GET http://127.0.0.1:80/archive/contents/bookmarks/Server1/future/past
POST http://IPaddress:port/prefix/archive/contents/bookmarks/create
The request body must contain the JSON with the begins_at,ends_at, comment,is_protected, endpoint and storage_id parameters (see Get bookmarks from archive):
A group bookmark will be linked to several cameras, however the begins_at,ends_at, comment andis_protected parameters are taken from the first array of elements.
Attention!
A group bookmark in a GET request (see Get bookmarks from archive) will look like several bookmarks with different endpoint and storage_id parameters.
To edit a group bookmark (see Edit bookmarks), it is necessary to edit all single bookmarks at the same time, and make sure that all their other parameters except endpoint and storage_id match.
Method: POST http://IP-Address:port/prefix/search/{auto|face|vmda|stranger|heatmap}/{DETECTORID}/{BEGINTIME/ENDTIME}
auto|face|vmda|stranger|heatmap – search type. The request body must include the "query" function if "vmda" search type is used (see Forensic Search MomentQuest (VMDA) API).
DETECTORID– endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).
The request will return either error or response like:
HTTP/1.1 202 Accepted
Connection: Close
Location: /search/(auto|face|vmda|stranger|heatmap)/GUID
Cache-Control: no-cache
Receiving the Accepted code does not guarantee successful execution of the search. This code only shows that the command has been taken to process.
Parameter
Description
Location
identifier for future access to search results. Example: /search/vmda/3dc15b75-6463-4eb1-ab2d-0eb0a8f54bd3
Error codes:
Error code
Description
400
Incorrect request.
500
Internal Server error.
Search results request
GET http://IP-Address:port/search/{auto|face|vmda|stranger|heatmap}/{GUID}/result
The /search/(auto|face|vmda)/GUID partis a result of the POST command (see Search request).
Parameter
Required
Description
limit
No
Maximum number of events returned by the request. uint32_t::max() by default.
offset
No
Results offset by the specified number. For example, if a query with offset=0 returned 100 results, then in order to get the next results, it is necessary to run a query with offset=100. If the second query returned 250 results, then in order to get the next results, it is necessary to run a query with offset=350, etc.
Search is not over. Repeat search results requests until status code 200 is returned. Set delays between repeated requests in order to reduce computationalburden.
200
Search is over.
Error codes:
Error
Description
400
Incorrect request.
404
The offset value is greater than current quantity of results or requested search ID (GUID) not found.
The /search/(auto|face|vmda)/GUID partis a result of the POST command (see Search request).
The command terminates the search operation and deallocates resources. Search results are not available after it is executed.
Error codes:
Error
Description
400
Incorrect request
Face search API
The POST request (see Search request) used for search start must contain binary data of searched face in jpеg format.
Note
All face detection triggerings are stored in the t_json_event database table.
The t_face_vector table stores the vectors of faces recognized by the detection tool.
The t_face_listed table stores the face images added to the list of people.
Parameter
Required
Description
accuracy
No
The accuracy parameter is a recognition rate from range [0, 1] (1 – complete match). This parameter is specified additionally in the search line or in the request body. Otherwise, the default value 0.9 will be used.
Attention!
The parameter value specified in the request body has higher priority.
Attention!
If the body of the POST request is empty, then the search will return all the results for the recognized faces. The accuracy parameter value in this case will be 0.
Sample request:
POST http://127.0.0.1:80/search/face/SERVER1/AVDetector.2/EventSupplier/past/future?accuracy=0.7
GET http://127.0.0.1:80/search/face/2e69ba76-23f1-4d07-a812-fee86e994b8e/result
Сamera channel to take analyzed video stream from.
timestamp
Time stamp of a video frame with a face detected by the detection tool.
accuracy
Recognition accuracy ranged [0,1], with 1 corresponding to full match.
position
Coordinates of a frame border enclosing face on a video frame.
LPR search API
The POST request (see Search request) used for search start must contain the following JSON:
{
"plate": "mask"
}
The plate parameter sets a search mask. The mask format corresponds to the one used in GUI (see LPR search).
Attention!
If the body of POST request is empty, then the search will return all the results for the recognized license plates.
Parameter
Required
Description
result_type
No
result_type=full means detailed response
Sample request:
POST http://127.0.0.1:80/search/auto/SERVER1/AVDetector.2/EventSupplier/past/future?result_type=full or POST http://127.0.0.1:80/search/auto/SERVER1/AVDetector.2/EventSupplier/past/future
GET http://127.0.0.1:80/search/auto/2e69ba76-23f1-4d07-a812-fee86e994b8e/result
This search type compares every recognized face with all faces in the camera database over 30 days (or for the current archive depth if it is less than 30 days) and sets the number of days over which this face was recognized by the camera. The search decides if this is a “familiar face” or a “stranger” by the specified criteria.
The POST request is used for search start (see Search request), search type is stranger, request body is empty.
The following parameters are available:
Parameter
Required
Description
accuracy
No
Sets face similarity level in the range [0,1] (1 means complete match). If this parameter is not set, then the default value (0.9) is in use. If the compared face was in the camera FOV on a specific day and it was recognized with accuracy that is not less than the specified one, then this face is considered to be present on that day. Otherwise, the algorithm considers this face was absent on that day.
Attention!
The accuracy parameter value can also be specified in the request body. In this case, it has higher priority over the value specified in the search line.
threshold
No
Determines the threshold value to recognize a face as a “stranger”. The value is set in the range from 0 to 1, and it determines the number of days within which the face was absent to be considered as a “stranger”: 30-30*threshold. For instance, the value 0.8 means “the required object appeared in the search area within (30 - 30 * 0.8 = 6) days”. All faces that appeared within 6 and more days will be defined as “familiar faces”, others—as “strangers”.
Attention!
The threshold and op parameters must only be used together. If any of parameters is not set or has incorrect value, then both parameters will be ignored.
op
No
Determines the search direction. Allowable values: lt—“familiar face” search (based on the threshold parameter) gt—“stranger” search
The body of POST request used for search start must contain binary data of searched face in jpеg format. The request itself can be represented in two ways:
POST http://IP-Address:port/prefix/faceAppearanceRate/{DETECTORID}/{BEGINTIME}/{ENDTIME}
DETECTORID – endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).
Rate of identifying a face as a “stranger”, the value in the [0,1] range. 1 means a complete stranger.
Heat Map API
POST http://IP-address:port/prefix/search/heatmap/{DETECTORID}/{BEGINTIME}/{ENDTIME}
DETECTORID – endpoint detection tool ternary ID (HOSTNAME/AVDetector.ID/EventSupplier for auto and face search, HOSTNAME/AVDetector.ID/SourceEndpoint.vmda for vmda, see Get list of detection tools).
Note
ENDTIME, BEGINTIME is the time in ISO format; it specifies the Heat Map interval.
The name of the archive in the "hosts/SERVER1/MultimediaStorage.AliceBlue/MultimediaStorage" format (see Get archive contents). If the value is not specified, the default archive will be used for searching
The response is presented as calendar days in milliseconds. They are counted from January 1, 1900, 0 hours 0 minutes. In this example, the days are from October 28 to November 02, 2021.