Go to documentation repository
On this page |
---|
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).
HTTP API allows using the following features:
Access the Face PSIM API and the Auto PSIM API (see Calling API of vertical solutions via Axxon PSIM HTTP API).
Set up integration with Technoserv and ECHD (see Configuring the Technoserv integration).
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).
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.
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.
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".