CompleteView v1.0 REST API Documentation
CompleteView v1.0 REST API Documentation
The CompleteView REST Cameras interface is currently supported via both HTTP and HTTPS as
enabled by the embedded Web Server and Secure Web Server respectively. It uses the existing
CompleteView HTTP authentication scheme, which means that credentials are conveyed via a Basic
authentication header. It returns textual resource information in multiple formats, currently only JSON
and HTML. Similarly, media is returned in multiple formats, currently MJPEG, JPEG, MPEG4 and H.264
for video, and G.711 uLaw for audio. This interface currently takes in all parameters via the request
URI string and not in the HTTP request body in a format such as JSON.
The REST interface processes requests and transmits media on CompleteView Server's configurable
Web Server and / or Secure Web Server TCP port(s). REST is a programmatic communications
interface, not a user interface. However, the design goals of this interface include adherence to the
REST “spirit,” allowing it to be easily used from a browser for experimentation and testing purposes.
Current practice on the web is to use the HTTP GET method for just about everything. However, REST
is stricter about method semantics. For example, it makes a distinction between requesting a
representation of a resource –a GET– and requesting an update to a resource –a PUT. Some HTTP
frameworks only support GET, and most browsers send a GET request when the user enters a URI into
the location bar. The workaround in our REST interface is to allow the requester to override the HTTP
method that his or her framework/browser generates with an optional, method query-string
parameter. For example, these two requests have the same semantics from the perspective of our
REST interface:
PUT /cameras/9/position/2
GET /cameras/9/position/2?method=put
This is the only parameter available for all requests, although it is probably only useful for those that
change resource state, such as for PTZ control.
The following sections describe the syntax and semantics of the CompleteView REST interface, or API.
It is sometimes referred to as the REST Cameras interface to distinguish it from any other that may be
added in the future, such as a REST administrative interface.
Support Information
For any questions or to report any bugs discovered in the CompleteView REST interface, please email
[email protected].
Authenticating Requests
The REST interface requires requests to include CompleteView user credentials transmitted in an
HTTP Basic authentication header as described here.
Examples
Request
The following GET request includes the authorization header with a username of “admin” and an
empty (“”) password.
GET /cameras
Gets server information and a list of configured cameras and their associated attributes such as user
permissions (based on the user that has been authenticated with the REST interface) and camera
capabilities.
Resource Information
Parameters
Enumerated Values
Notes
Dimensions are for the current, live video stream. If the camera is not online at the time of the
request, dimensions are not included.
Recorded video may have dimensions that differ from what is currently being streamed from
the camera.
Examples
Request
GET /cameras?accept=application/json
Response
{
"servers": [
{
"address": "StephenDev-PC",
"name": "StephenDev-PC1",
"serialNumber": "0d763f7ce0d8db8055189beaaab5cc11",
"license": "enterprise",
"dptzPlayback": true,
"product": {
"name": "CompleteView",
"version": "4.5.0.96"
},
"utcOffset": "-05:00",
"cameras": [
{
"id": 1,
"name": "AXIS Q1602 at 192.168.103.203",
"state": "online",
"audioEnabled": false,
"lightAvailable": false,
"disableStreamProcessing": false,
"ipStreamType": "h264",
"permissions": {
"live": true,
"recorded": true,
"exportable": true,
"allow_snapshot": true,
"allow_light_control": true,
"audio": true,
"quickTrackCamera": false
},
"dimensions": {
"width": 640,
"height": 480
},
"ptz": {
"pan": true,
"tilt": true,
"zoom": true,
"reset": true,
"presets": 10,
"digital": true,
"presetNames": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
},
{
"id": 2,
"name": "Axis Q6044 - 720P",
"state": "online",
"audioEnabled": false,
"lightAvailable": false,
"disableStreamProcessing": false,
"ipStreamType": "h264",
"permissions": {
"live": true,
"recorded": true,
"exportable": true,
"allow_snapshot": true,
"allow_light_control": true,
"audio": true,
"quickTrackCamera": false
},
"dimensions": {
"width": 1280,
"height": 720
},
"ptz": {
"pan": true,
"tilt": true,
"zoom": true,
"iris": true,
"focus": true,
"autoIris": true,
"autoFocus": true,
"presets": 10,
"digital": false,
"presetNames": [
"Main Entrance",
"Loading Dock",
"Parking Lot",
"",
"",
"",
"",
"",
"",
""
]
}
}
]
}
]
}
Request
GET
/cameras?accept=application/javascript&callback=jQuery16203128881240285475_1
322766825181&_=1322768532287
Response
jQuery16203128881240285475_1322766825181({
"servers": [
{
"address": "StephenDev-PC",
"name": "StephenDev-PC1",
"serialNumber": "0d763f7ce0d8db8055189beaaab5cc11",
"license": "enterprise",
"dptzPlayback": true,
"product": {
"name": "CompleteView",
"version": "4.5.0.96"
},
"utcOffset": "-05:00",
"cameras": [
{
"id": 1,
"name": "AXIS Q1602 at 192.168.103.203",
"state": "online",
"audioEnabled": false,
"lightAvailable": false,
"disableStreamProcessing": false,
"ipStreamType": "h264",
"permissions": {
"live": true,
"recorded": true,
"exportable": true,
"allow_snapshot": true,
"allow_light_control": true,
"audio": true,
"quickTrackCamera": false
},
"dimensions": {
"width": 640,
"height": 480
},
"ptz": {
"pan": true,
"tilt": true,
"zoom": true,
"reset": true,
"presets": 10,
"digital": true,
"presetNames": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
},
{
"id": 2,
"name": "Axis Q6044 - 720P",
"state": "online",
"audioEnabled": false,
"lightAvailable": false,
"disableStreamProcessing": false,
"ipStreamType": "h264",
"permissions": {
"live": true,
"recorded": true,
"exportable": true,
"allow_snapshot": true,
"allow_light_control": true,
"audio": true,
"quickTrackCamera": false
},
"dimensions": {
"width": 1280,
"height": 720
},
"ptz": {
"pan": true,
"tilt": true,
"zoom": true,
"iris": true,
"focus": true,
"autoIris": true,
"autoFocus": true,
"presets": 10,
"digital": false,
"presetNames": [
"Main Entrance",
"Loading Dock",
"Parking Lot",
"",
"",
"",
"",
"",
"",
""
]
}
}
]
}
]
});
GET /cameras/:camera-id/clip
Gets a finite multipart stream of video or audio corresponding to a specified time period and camera.
The stream is not throttled to the native FPS as this endpoint is intended to be used for media export.
Resource Information
Parameters
Notes
The TCP socket connection is closed when the stream has reached its end point.
The accept, quality, bitrate and keyrate parameters only have an effect if transcoding is
enabled.
stop must be later in time than start.
The quality, bitrate and keyrate parameters are only relevant for video streaming.
The initial HTTP response headers will include some useful information regarding the media
stream. For video streams, they include video height and width, if the video stream has audio
associated with it, the media type (which if transcoding is turned off, will be the native format),
the Connection ID (used for Digital PTZ), the average time per frame which is used to calculate
the frame rate and a cookie that should be recorded and sent with VCR control requests as well
as Digital PTZ requests. For audio streams, they include the number of audio channels, the bits
per sample and the sample rate.
Not every multipart section will include media, recipients should always check the Content-Type
and / or Content-Length.
Multipart sections that do include media will include additional headers such as Pre-roll (video),
Sync-Point (video), various timestamps, and whether or not the stream is at the end.
There is another type of multipart section that MAY be interlaced with media sections to notify a
recipient when the server has to switch AVI files. During this process, it is possible that the
media type or presence of audio has changed. This should be handled by client code.
Examples
Video - Request
GET /cameras/1/clip?start=2015-06-23T12:12:12Z
Response
The below response includes the possible multipart sections that MAY come across the wire in this
particular request scenario. Generally, there are one or more media sections, zero or more transition
sections, and one or more end of stream notifications (depending on whether or not the position of
the stream has been changed and the stream ends more than once).
\r\n
--myboundary\r\n
Content-Type: image/jpeg\r\n
Sync-Point: no\r\n
Pre-roll: no\r\n
Media-Start: invalid\r\n
Media-End: invalid\r\n
Stream-Start: invalid\r\n
Stream-End: invalid\r\n
Content-Length: 0\r\n
X-Date: 0\r\n
End-of-Stream: yes\r\n
\r\n
Audio - Request
Note that the cookie that was sent with the video stream was sent with the audio request.
GET /cameras/1/clip?accept=audio/basic&start=2015-06-25T20:11:55.199Z
HTTP/1.0\r\n
Host: 192.168.103.58:4502\r\n
User-Agent: CompleteView Web Client 4.5.1.10\r\n
Authorization: Basic YWRtaW46\r\n
Cookie: stream=38751481\r\n
\r\n
Response
There are no transition multipart sections in the audio stream as there are with the video stream.
--myboundary\r\n
Content-Type: audio/basic\r\n
Media-Start: invalid\r\n
Media-End: invalid\r\n
Stream-Start: 320000\r\n
Stream-End: 640000\r\n
Content-Length: 256\r\n
End-of-Stream: no\r\n
\r\n
{audio-samples}
\r\n
GET /cameras/:camera-id/clips
Gets a list of video clip recordings available for a specified time period.
Resource Information
Parameters
Notes
Examples
Request
GET
/cameras/1/clips?accept=application/json&start=2015-06-23T21:44:12Z&stop=201
5-06-23T21:46:12Z
Response
{
"clips": [
{
"begin": "2015-06-23T21:44:51Z",
"end": "2015-06-23T21:45:00Z",
"xBegin": "2015-06-23T21:44:51.957Z",
"xEnd": "2015-06-23T21:45:00.127Z",
"size": 80,
"type": "motion"
},
{
"begin": "2015-06-23T21:45:00Z",
"end": "2015-06-23T21:45:19Z",
"xBegin": "2015-06-23T21:45:00.130Z",
"xEnd": "2015-06-23T21:45:19.153Z",
"size": 128,
"type": "scheduled"
},
{
"begin": "2015-06-23T21:45:19Z",
"end": "2015-06-23T21:45:27Z",
"xBegin": "2015-06-23T21:45:19.157Z",
"xEnd": "2015-06-23T21:45:27.107Z",
"size": 73,
"type": "motion",
"description": "StartMotionTimedReason_Click"
}
]
}
GET /cameras/:camera-id/videofiles
Gets a list of video files available for a specified time period. This differs from the clips call in that
every underlying AVI file is returned instead of being coalesced together.
Resource Information
Parameters
Notes
Examples
Request
GET
/cameras/1/videofiles?accept=application/json&start=2017-01-30T00:00:00Z&sto
p=2017-01-30T23:59:59Z
Response
{
"video_files": [
{
"id": 1,
"fileStart": "2017-01-30T16:50:28.843Z",
"fileEnd": "2017-01-30T16:53:29.847Z",
"size": 29295,
"type": "scheduled"
},
{
"id": 5,
"fileStart": "2017-01-30T16:53:29.860Z",
"fileEnd": "2017-01-30T16:56:30.847Z",
"size": 26399,
"type": "scheduled"
},
{
"id": 9,
"fileStart": "2017-01-30T16:56:30.857Z",
"fileEnd": "2017-01-30T16:59:31.850Z",
"size": 24694,
"type": "scheduled"
}
]
}
GET /cameras/:camera-id/videofilesdownload
Retrieves an individual AVI recording file. This is intended to be called with the fileStart and fileEnd
time received from the video files call.
Resource Information
Parameters
Notes
Examples
Request
GET
/cameras/1/videofilesdownload?accept=application/json&start=2017-01-30T16:50
:28.843Z&stop=2017-01-30T16:53:29.847Z
Response
GET /cameras/:camera-id/presetnames
Resource Information
Parameters
Examples
Request
GET /cameras/1/presetnames?accept=application/json
Response
{
"presetNames": [
"Main Entrance",
"Loading Dock",
"Parking Lot",
"",
"",
"",
"",
"",
"",
""
]
}
PUT /cameras/:camera-id/light
Resource Information
Parameters
Notes
Examples
Request
PUT /cameras/1/light?lightvalue=100
GET /cameras/:camera-id/media
Gets a live multipart stream of video or audio or a still image of live or recorded video. This endpoint
is also used to control playback via VCR controls.
Resource Information
Parameters
Notes
Examples
GET /cameras/1/media
Response
\r\n
--myboundary\r\n
Content-Type: image/jpeg\r\n
Sync-Point: yes\r\n
Pre-roll: no\r\n
Media-Start: invalid\r\n
Media-End: invalid\r\n
Stream-Start: 131184\r\n
Stream-End: 464517\r\n
Content-Length: 99609\r\n
End-of-Stream: no\r\n
Camera-Status: 0\r\n
\r\n
{video-frame}
\r\n
GET /cameras/1/media?width=640&height=480&fps=10&quality=75
GET /cameras/1/media?accept=audio/basic
GET /cameras/1/media?accept=image/jpeg
GET /cameras/1/media?start=2015-06-23T21:44:12Z&stop=2015-06-23T21:46:12Z
Response
Pre-roll: no\r\n
Media-Start: invalid\r\n
Media-End: invalid\r\n
Stream-Start: 855254\r\n
Stream-End: 1188587\r\n
Content-Length: 99734\r\n
X-Date: 2015-06-25T20:11:55.199Z\r\n
End-of-Stream: no\r\n
\r\n
{video-frame}
\r\n
GET
/cameras/1/media?start=2015-06-23T21:44:12Z&stop=2015-06-23T21:46:12Z&positi
on=2015-06-23T21:45:12Z
GET
/cameras/1/media?accept=audio/basic&start=2015-06-25T20:11:55.199Z&stop=2015
-06-25T20:21:55.199Z HTTP/1.0\r\n
Host: 192.168.103.58:4502\r\n
User-Agent: CompleteView Web Client 4.5.1.10\r\n
Authorization: Basic YWRtaW46\r\n
Cookie: stream=38745961\r\n
\r\n
Response
\r\n
{audio-samples}
\r\n
GET /cameras/1/media?accept=image/jpeg&start=2015-06-23T21:44:12Z
GET /cameras/1/media?position=2015-06-23T21:44:12Z
GET /cameras/1/media?speed=2.0
GET /cameras/1/media?action=pause
GET /cameras/:camera-id/thumbnails
Gets a multipart stream of JPEG frames from a recorded time period with frames being grabbed from
specified intervals.
Resource Information
Parameters
Notes
Examples
Thumbnails - Request
GET /cameras/1/thumbnails?start=2015-06-23T12:10:00Z
Response
End-of-Stream: no\r\n
Camera-Status: 0\r\n
\r\n
{video-frame}
\r\n
GET
/cameras/1/thumbnails?start=2015-06-23T12:10:00Z&width=640&height=480&interv
al=600000000&quality=75
PUT /cameras/:camera-id/position
Controls either digital or physical PTZ on either a live or a recorded video stream.
Resource Information
Parameters
Signedness semantics
+ -
Pan right left
Tilt down up
Zoom in out
Focus near far
Iris close open
Notes
If no parameters are specified, this will result in an error, as there is nothing useful to do.
The Cookie stream-id received from a recorded video media request is required if Digital PTZ is
being controlled on a recorded video stream.
Examples
PUT /cameras/1/position?x=-500&y=-500
Zoom In - Request
PUT /cameras/1/position?z=700
PUT /cameras/1/position?z=700&dptz_id=67
PUT /cameras/1/position?x=0&y=0&z=0&f=0&i=0
PUT /cameras/:camera-id/position/:ptz-id
Controls either digital or physical PTZ presets on either a live or a recorded video stream.
Resource Information
Parameters
Notes
The Cookie stream-id received from a recorded video media request is required if Digital PTZ is
being controlled on a recorded video stream.
Examples
Go to Preset - Request
PUT /cameras/1/position/7
PUT /cameras/1/position/7?dptz_id=67
PUT /cameras/1/position/11?current
PUT /cameras/1/position/11?current&preset_name=Main%20Entrance
The CompleteView REST Users interface is very similar to the Cameras interface, in that it follows a
similar syntax and requires the same authentication. The users interface was built to give insight into
the Active Directory users, Active Directory groups and CompleteView groups that the CompleteView
server has access to.
GET /users/groups
Resource Information
Parameters
Examples
Request
GET /users/groups?user=admin
Response
{
"users": [
{
"user": "Administrators"
},
{
"user": "Test Group"
}
]
Salient's Wiki - https://wiki.salientsys.com/
Last update:
2017/01/30 engineering:development:apis:cv_cameras_rest https://wiki.salientsys.com/engineering:development:apis:cv_cameras_rest
12:15
GET /users/activedirusers
Gets the Active Directory users that CompleteView has access to.
Resource Information
Examples
Request
GET /users/activedirusers
Response
{
"users": [
{
"user": "Guest"
},
{
"user": "Administrator"
},
{
"user": "VM"
},
{
"user": "GuestAcct"
},
{
"user": "demo"
},
{
"user": "UPS"
},
{
"user": "temp"
}
]
}
GET /users/activedirgroups
Gets the Active Directory users that CompleteView has access to.
Resource Information
Parameters
Notes
If nested group support is enabled in the server configuration, this query could potentially take
several minutes to complete.
Examples
GET /users/activedirgroups
Response
{
"users": [
{
"user": "Domain Computers"
},
{
"user": "Domain Controllers"
},
{
"user": "Guests"
},
{
"user": "Domain Users"
},
{
"user": "Domain Admins"
},
{
"user": "Users"
}
]
}
GET /users/activedirgroups?user=test
Response
{
"users": [
{
"user": "Domain Users"
},
{
"user": "Domain Admins"
},
{
"user": "Users"
}
]
}
From:
https://wiki.salientsys.com/ - Salient's Wiki
Permanent link:
https://wiki.salientsys.com/engineering:development:apis:cv_cameras_rest