Antcas API

The Antcas API allows data to be exchanged between multiple applications.

WARNING: Pay attention to security when using this API. Use only TLS and never use the port on a publicly accessible address.

Note: Since the API must verify the token with each call, this can result in higher system load.

Setting Up an API Port

Under Project Management, a new API Port can be added. The description can be found in the chapter Assigning a Port to the Project.

To create a request, it must be authenticated using an Token. Creating a token is explained in more detail in the chapter Managing Tokens.

Formats and Values

The API supports multiple input formats: HTTP Queries, JSON, and XML. The output can be HTML, Text, JSON, or XML. The character encoding is always UTF-8.

Note: A call by an element in the browser results in error 428 (Precondition Required). This is the XSS attack protection and cannot be bypassed. It prevents a hacking attack on Antcas Control.

With a POST or PUT request, data can be written via the content in the corresponding format. Each variable is case-sensitive, meaning that uppercase and lowercase letters are distinguished. However, the return is always in the declared format. The output format can be described via header or through the variable format. The input format is always automatically detected.

GET /visu/var/eid?format=json&token=tokenid HTTP/1.1
Host: serveraddr.com
Content-Type: application/json

The following formats are supported in the header and as variable format:

Content-Type Variable Format
application/json json JSON
application/xml xml XML
text/plain text Text
text/csv csv CSV*
(others) html HTML

*Only supported as output format.

Note: The Text and CSV formats contain the UTF-8 BOM. This can be deactivated using the variable bom=FALSE.

If a value is described via multiple formats, the latter format has priority:

  • HTTP Header (only output format via Content-Type)
  • GET
  • POST
  • JSON/XML (as POST or PUT content)

Input Variables

The following variables are globally defined.

Variable Description
format Output format.
bom BOM in UTF-8 format. Default is TRUE.
key Reads only one variable that was declared. This method is inefficient because all data is prepared and then filtered. It should only be used with small amounts of data.
header Output header. Default is TRUE.
compact Collapses all sub-elements into itself. If no boolean value is declared, this value is taken to combine the variables. Otherwise, the value . is used.
values Returns only values and no variable names. This option is only available for HTML, CSV, and Text.
minimal Alias for header=FALSE, compact=minimal, and values=TRUE.
csvdel CSV delimiter. Default is ;
csvenc CSV enclosure brackets. Default is "
csvesc CSV escape character. Default is \

The following variables can be used globally as well as for individual variables. To address a single variable, it is defined as follows:

time*:hr=true

The above example addresses all variables starting with time and time itself. All rules are checked in sequence. Thus, the last matching rule has precedence. The search is performed using regular expressions.

Variable Description
hr Human Readable. Variables are converted, if possible, into human-readable data. Default is TRUE for the HTML, CSV, and Text formats.
numdec Number of decimal places.
numths Thousand separator.
numdot Decimal separator.
prefix Add text before variable.
suffix Add text after variable.

Paths

All applications of the API are defined in the chapters below.

Subordinate Pages