HTTP Access (controlling Agent via http requests)
HTTP Server Access
HTTP access is useful for interfacing Agent with external triggers (like trip wires/ temperature sensors etc), other running applications and moderate to high-end IP cameras that have their own motion detection code built in (useful to reduce the CPU load of ispy on your computer).
Before you start using HTTP access you will need to know the ID of them camera or microphone that you want to control.
The HTTP format follows the pattern "http://IPADDRESS:PORT/command.cgi?cmd=COMMAND&ot=OBJECT_TYPE&oid=OBJECT_ID
The IP address is the IP address of the computer running Agent. The PORT is the local server port that Agent is using. You can set this in Server Settings on the web portal. The default is 8090. OBJECT_TYPE is either 1 for a microphone or 2 for a camera. The OBJECT_ID is provided in the objects list when you click on a Server in the web portal.
|These commands can be called over HTTP. Where Specific Object is Yes that means you must pass in the object type id and the object id (as above). Where All Objects is Yes that means the object id/ type is optional and if not supplied the command will affect all objects. For example to record via HTTP you'd use http://yourserver:port/command.cgi?cmd=record&ot=2&oid=1. To record all objects you'd use http://yourserver:port/command.cgi?cmd=record|
|recordswitch||Starts or stops recording depending on the current state. Returns "recording,OK" or "notrecording,OK"|
|alert||Trigger the alert on the specified object. Returns "OK"|
|record||Starts recording on the specified object. Returns "recording,OK"|
|recordstop||Stops recording on the specified object. Returns "notrecording,OK"|
|ping||Returns "OK" - use this to check the ispy server is alive|
|allon||Switch all objects on. Returns "OK".|
|alloff||Switch all objects off. Returns "OK".|
|recordondetecton||Switches on Record on Detect mode (switches off Record on Alert mode)|
|snapshot||Take a frame snapshot of the specified camera and save it to the grabs directory|
|recordonalerton||Switches on Record on Alert mode (switches off Record on Detect mode)|
|recordingoff||Switches off all recording modes|
|applyschedule||Apply schedule to all objects|
Using groups in place of object IDs
You can also use group names in place of object ids for commands - for example to switch alerts on for a group called "office" you'd do:
- this will switch alert mode on for all cameras and microphones with the group name "office". You can set the group name for cameras and microphones on the first tab when editing them.
You can generate an MJPEG stream by using video.mjpg?camids=1,2,3&size=320x240
You can get a still image by using grab.jpg?oid=1&size=320x240