Table of Contents  MOBOTIX Online Help

The HTTP API

Table of Contents
The HTTP API
Modifying the Settings of the Setup Menu
Using the vPTZ Features
Executing Camera Functions
Command Conventions
The control Command
The click.cgi Interface
The rotorcgi Interface
The rcontrol Command

The HTTP API (Application Programming Interface) is a software interface to the camera and allows to conveniently integrate the camera into a centralized management system. The interface consists of several CGI scripts that can be called with parameters and values using HTTP commands. By means of these scripts, you can modify the settings of the dialogs in Setup Menu and execute certain camera functions.

Modifying the Settings of the Setup Menu

Using the HTTP command http://192.168.0.238/control/control, you can modify the settings of the Setup menu.

Using the vPTZ Features

As a consequence of integrating the Q camera models, the cameras now offer the vPTZ features (virtual Pan/Tilt/Zoom) also in the HTTP API. The corresponding features have been documented on specific help dialogs, which can be opened using the corresponding links:

  • click.cgi: This interface provides limited access to simple vPTZ features.

  • rotorcgi: This interface provides full access to all vPTZ features.

  • control?list&section=vptzcontrol: control also provides access to some vPTZ features, as outlined in the vptzcontrol section.

Executing Camera Functions

Using the HTTP command http://192.168.0.238/control/rcontrol, you can execute certain camera functions.

Caution

Certain functions for Saving and Restoring the configuration can only be performed by a user of the admin access level. In this case, you need another HTTP command for calling the rcontrol script, namely:

http://192.168.0.238/admin/rcontrol

Command Conventions

Command With One Instruction

If you would like to use the list instruction with the control command, you need to separate the instruction from the command using a ?:

http://192.168.0.238/control/control?list

Command With One Instruction and a Parameter/Value Pair

In order to execute an instruction with a parameter, the instruction needs to be separated from the parameter by an ampersand &. The parameter value is separated by a = sign.

http://192.168.0.238/control/control?list&section=actions

Command With One Instruction and Several Parameter/Value Pairs

If you would like to use multiple parameters, separate them using an ampersand &:

http://192.168.0.238/control/rcontrol?action=ledson&time=5

Several Values for One Parameter

For some parameters you need to enter two values in order to address both lenses. These parameters are shown as having two default values (e.g. 0 0). In the http command, you will need to separate these values using a + sign :

http://192.168.0.238/control/control?set&section=general&sharpen=0+0

Newline Characters in Commands

If you would to use one or more newline characters in a command (e.g. to set several video motion window definitions), you need to replace the newline characters using the CGI replacement string %0A.

http://192.168.0.238/control/control?set&section=general&coverimage_area=0,540,380,200,200,2%0A1,320,100,100,150,2

Special Characters in Commands

In order to display the CGI formatting strings themselves (newline, blank, umlauts, ...), enter the URL-encoded characters. To do this, enter a % sign followed by the hex value of the character you would like to display. The following table contains a list of the most common characters:

Character

URL-Encoding

Character

URL-Encoding

Character

URL-Encoding

(Newline)

%0A

(Blank)

%20 or +

%

%25

&

%26

+

%2B

=

%3D

?

%3F

©

%A9

®

%AE

ß

%DF

ä

%e4

Ä

%c4

ö

%F6

Ö

%D6

ü

%FC

Ü

%DC

Ç

%c7

à

%e0

á

%e1

â

%E2

æ

%E6

ç

%E7

è

%E8

é

%E9

ê

%EA

ë

%EB

î

%ee

ï

%EF

ô

%F4

ù

%F9

ú

%FA

ù

%FB

û

%fc

For further information, please see en.wikipedia.org/wiki/URL_encoding.

Table of Color Values

You may specify color values for certain parameters. These values correspond to the hex values of the red, green and blue (RGB) values of a specific color. Two characters each represent on color, 00 represents the lowest value (no color), FF represents the highest value (full color). Since the colors are mixed additively, 0x000000 represents black and 0XFFFFFF represents white.

Color name

Hexadecimal notation

Color

Color name

Hexadecimal notation

Color

Black

0x000000

Maroon

0x800000

Dark green

0x008000

Olive

0x808000

Marine

0x000080

Purple

0x800080

Teal

0x008080

Dark gray

0x808080

Light gray

0xC0C0C0

Red

0xFF0000

Green

0x00FF00

Yellow

0xFFFF00

Blue

0x0000FF

Magenta

0xFF00FF

Cyan

0x00FFFF

White

0xFFFFFF

The control Command

First of all, you need to tell the camera which instructions are to be performed.

Instructions for the control Command

Instruction

Description

set

Write access to the settings. Use this instruction to modify the settings.

http://192.168.0.238/control/control?set&<parameter>=<value>[&<parameter>=<value>]

read

Read access to the settings. Use this instruction to query information about the settings.

http://192.168.0.238/control/control?read&<parameter>[&<parameter>]

list

The list instruction returns a list of the configuration file sections that can be modified.

To retrieve the parameters of one particular section, add section=<sectionname> at the end of the call.

Example:

http://192.168.0.238/control/control?list&section=actions lists all options of the actions section.

This command allows reading the current values and it provides a method for obtaining the possible options and the texts of the user interface by other applications.

factory

The factory instruction allows you to reset the parameters of a section to the factory default settings. This call requires the section name section=<sectionname> as additional parameter.

http://192.168.0.238/control/control?factory&section=<section name>

restore

The restore instruction allows you to reset the parameters of a section to the values stored in the flash memory. This call requires the section name section=<sectionname> as additional parameter.

http://192.168.0.238/control/control?restore&section=<section name>
Accessing Profile Parameters

A profile stores several settings in one value:

<profile designator>=<name>[:<parameter>=<value>].

Note that several profiles with identical <profile designators> can co-exist. Since profiles cannot be properly edited using the read and set commands, you need to use the following commands:

Instruction

Description

read_profile

Read a profile.

http://192.168.0.238/control/control?read_profile=<profile designator>:<name>

delete_profile

Delete a profile.

http://192.168.0.238/control/control?delete_profile=<profile designator>:<name>

set_profile

Write a profile.

http://192.168.0.238/control/control?set_profile=<profile designator>:<name>&<parameter>=<value>[&<parameter>=<value>]

add_profile

Add a profile.

http://192.168.0.238/control/control?add_profile=<profile designator>:<name>&<parameter>=<value>[&<parameter>=<value>]

In addition, some profiles have more parameters, which are identified by a leading underscore character:

Parameter

Description

_profilename

This profile has a real name. Instead of the <name> value, the user interface of the camera always shows the value of the real name. This name can contain UTF-8 characters (some of them need to URL-encoded in order to maintain the syntax) and does not necessary need to be unique.

_profilestate

At the moment, the value of the profile state can be empty (_profilestate=) or it can be letter i (_profilestate=i). An empty value activates the profile, the letter i deactivates it (see event profiles, for example).

List of Sections of the control Command

The sections shown in the following tables correspond to all dialogs that you can control remotely using the control command. Click on one of the links listed below to go to the corresponding section.

Note

Please note that the contents of this frame will only be displayed if the API right in the Group Access Control Lists is publicly accessible or the group of your user name has this right.

The click.cgi Interface

This interface provides limited access to simple vPTZ features. Use the list command to get the list of commands provided by this interface:

http://192.168.0.238/control/click.cgi?list

The help command returns detailed information and examples for using the individual commands:

http://192.168.0.238/control/click.cgi?help

The query command returns information on the current vPTZ settings:

http://192.168.0.238/control/click.cgi?query

The rotorcgi Interface

This interface provides full access to vPTZ features. The help command returns detailed information for using the individual commands:

http://192.168.0.238/control/rotorcgi?help

The rcontrol Command

The first value expected by the script is always the name of the action that is to be performed. Depending on the action, you may have to provide additional parameters. For the additional parameters mandatory and optional parameters are used.

Notes

  • Please note that the contents of this frame will only be displayed if the API right in the Group Access Control Lists is publicly accessible or the group of your user name has this right.

  • This page of the camera is only available in English.

Note

In order to see all options for the rcontrol command, enter the list instruction in your browser's address bar:

http://192.168.0.238/control/rcontrol?list


© 2001-2024 MOBOTIX · https://www.mobotix.com