Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Calling API of vertical solutions via Axxon PSIM HTTP API  Product version Next page


On this page

Software implementation

HTTP API is represented by web2 module—Web-server 2.0 (see Configuring the Server to connect the Clients via the Web server 2.0 module).

Features

HTTP API allows using the following features:

  1. Get information about interactive maps: map list, map name, map layer list, layer parameters, layer background image, information about the list of points and an individual point on the layer (see Map).
  2. Get information about object classes created on the Server, a list of states for the object class and information about status, icons for a specific state (see Object classes).
  3. Get a list of objects created on the server, information about the individual object, the state of the object, the list of available actions with the object (see Objects).
  4. Receive events from the Server both separately and by blocks (see  Getting events).
  5. Send commands to the server (see  Sending commands to server).
  6. Run macros (see Macros).
  7. Work with video: get frames, request configuration, receive live and archive video, manage recording, arm and disarm cameras, manage telemetry (see Video).
  8. Get live and archive sound (see Sound).
  9. Get a list of users (see Users).
  10. Send events and reactions to the core of the Axxon PSIM software (see  Sending reactions and events to Axxon PSIM using HTTP request).
  11. Access the Face PSIM API and the Auto PSIM API (see Calling API of vertical solutions via Axxon PSIM HTTP API).

  12. Set up integration with Technoserv and ECHD (see Configuring the Technoserv integration).

Specifics and limitations

  1. The following notation is used in the examples shown in this section:
    1. Port stands for port number. The default Web-server 2.0 module port is 8085. Specifying port in HTTP API commands is mandatory.
    2. /web2 – web context where the web2 app operates. This is the web-app context.
      Further the description will be omitted when query action is clear in the context.
  2. URL, id of objects and file extension are case-sensitive.
  3. Date and time are specified in RFC 3339 format, see details at http://www.ietf.org/rfc/rfc3339.txt.
  4. Compression of messages from kernels should be disabled, that is, the registry key MsgCompressOn=0 (see Axxon PSIM base version registry keys).

Authorization

Authorization is needed for requests. Two types of authorization are supported: Basic and Bearer.

With the Basic authorization type, it is necessary to add user data to all HTTP requests in the following form:

http://[username]:[password]@[IP-address]:[port]/web2

With the Bearer authorization type, the token received from the web server is used (see Authorization using a token key).

Default response format

By default, the response is in the JSON format. The default response in XML format can be enabled on the settings panel of the Web-server 2.0 object (see Configuring default response type for HTTP API requests). Also, the response format can be explicitly specified in the Accept header, for example application/json or application/xml. The response format specified in the request has a higher priority than the default response format specified on the settings panel of the Web-server 2.0 object.

Cross domain requests (CORS)

To perform cross-domain requests or to access the necessary headers in the response (for example, due to CORS browser policy restrictions), it is necessary to specify Origin (the domain of the site from which the request is made) in the request header. In this case, the response will contain the Access-Control-Allow-Origin header, which indicates that the resource can be accessed from the specified domain in a cross-site manner. The Access-Control-Allow-Origin: * header indicates that the resource can be accessed from any domain in a cross-site manner.

Using HTTPS

By default, Web server 2.0 uses the HTTP protocol. To transfer data via the HTTPS protocol, it should be first enabled in Web-server 2.0 and in the Web-server object settings (see HTTPS settings and Parameters of connecting Clients to the Web-server). The default port for HTTPS is 8443.

If the use of HTTPS is not enabled in the settings, but port 8443 is used in the requests, then they will be redirected to HTTP. For example, if you request "https://127.0.0.1:8443/web2/secure/configuration", it will be automatically redirected to "http://127.0.0.1:8085/web2/secure/configuration".


  • No labels