Forums/Version 2/Integration

Version 2 API

Curtis Hall
posted this on November 07, 2011 11:35

Last updated 11/7/2011

Using the Bluecherry API to control or view a camera requires knowing the device ID.  Currently this can be found in the XML file. 

Note:  The XML file will only generate the device IDs that the user has access to.  Make sure you have access to all cameras, or that you are using an administrator login if you plan on controlling all cameras.

https://login:password@bluecherry-server/ajax/devices.php?XML=true&short=true

Once you obtain the device id, you can obtain a multi-part JPEG image from this URL:

https://login:password@bluecherry-server/media/mjpeg.php?id={camera_id}&multipart=true

Below is a example URL for controlling a Pan / Tilt / Zoom camera through the Bluecherry API.

https://login:password@bluecherry-server/media/ptz.php?id={camera_id}&command={command}&panspeed={speed}&tiltspeed={speed}&pan={pan_command}&tilt={tilt_command}&zoom={zoom-command}&duration={duration}&preset={preset_id}&name={preset_name}

Supported Pan / Tilt / Zoom commands

 query -- display XML with camera information/PTZ capabilities and presets
 move
-- pan/tilt/zoom using parameters
 stop
-- stop movement
 save
-- save present
 rename
-- rename a preset
 go
-- go to specified preset
 clear
-- clear preset

Pan / Tilt / Zoom Variables:

preset_id -- id of the preset
preset_name
-- new preset name
speed
: pan/tilt speed
pan_command
: (l)eft / (r)ight
tilt_command
: (u)p / (d)own
zoom_command
: (t)ight / (w)ide
duration
: for how long to execute command; -1 for continuous