BI API

Information about the API for the Business Intelligence module

Operating mode

Cloud Suite

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 17.11.2020
Updated: 19.05.2025 | Optional currency parameter introduced with Vertec 6.8.

API (Application Programming Interface) for querying BI data from external applications. The call is made via <ServerURL>/api/bi.

In the configuration file Vertec.ini, the parameter BI API is available for this:

[CloudServer]
BI API=True

Standard is True. This means that the BI API runs even if the parameter is not specified.

The BI API can only be used if you have licensed the Business Intelligence module.

The BI user rights are applied.

You can find a detailed sample application with Postman/Excel here.

Authentication

BI API authentication occurs via API token. This must be passed as a Bearer token in an Authorization header:

import requests
url = 'http://localhost:8081/api/bi/measures'
api_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.MGVhZmUzMzYtNmVhMi00MDdhLTgxNjQtZDYxZmI0NzU2MWZi._r16YlvWmZCMJ3qdDX3bK5_DJHwcczTYaWoKUYUNZuk'
headers = {'Authorization': 'Bearer %s' % api_token}
r = requests.get(url, headers=headers)
measures = r.text

Note: In Vertec versions before 6.6, authentication was done via HTTP Basic Auth with user name and password. You can find the relevant information below.

Endpoints

Under /api/bi, the following GET endpoints are available:

/getdata

The BI data is processed via endpoint /getdata queried. It accepts the following parameters via query string:

measures

Mandatory.

Comma-separated list of internal measure names (e.g. "feesext,minutesint"). You can find the list of internal names of the supplied default measures here.

dimension

Mandatory, case-insensitive.

List of dimensions by which the result is grouped (e.g. "Projekt,Projektbearbeiter"). You can find the list of dimensions of the supplied default measures here.

As a pseudo-dimension, "Month" can also be specified. Key date values such as OvertimeBalance are only accepted for a time series. For these values, you also have to specify dimension=month, otherwise an error message appears.

If there are different roles for the dimension, access can be made via a suffix [Index 0-4].

  • Projekt selects the dimension project without role.
  • Projekt_1 selects the dimension project to index 1 on the metric. This must then be a role on the project.
  • etc.

Example when querying the measure FeesExt (external fee):

    dimension0 = Projekt
    dimension1 = Projektbearbeiter_1
    dimension2 = Projektbearbeiter_2
    dimension3 = ProjektPhase
    dimension4 = Taetigkeit
    dimension5 = Month

If several measures with different “dimension structures” are requested and the requested dimensions cannot be delivered across all measures, a relevant error message appears. If this happens, you have to bundle the measures with the same dimension structure into a query and discontinue several of these queries in order to extract all data.

_variable and OCL expression

Optional. As of Vertec 6.5.0.11, you can specify for each dimension parameter (dimension0=Projekt, dimension1=Projektbearbeiter etc.), alias parameters with an OCL expression as a value dimension0_Projekttyp=typ.bezeichnung.

This adds a new field Projekttyp to the response, which contains the designation of the project type of the project dimension value.

You can specify any number of alias parameters per dimension. If the parameter used matches a name that is already used (as a measure name, class name or its translations, or alias of another dimension), an error is reported.

startDate
Optional. Start date in ISO 8601 format (2020-01-01)
endDate
Optional. End date in ISO 8601 format (2020-12-31)
selectExpression

Optional. OCL expression for selection.

useDescriptions

Optional, True or False. Default: False.

Determines whether the column labels are delivered in plain text and translated, or as internal technical designations that are language independent.

f

Optional. Determines the format in which the result is output:

  • csv: returns the result as a CSV file
  • json: returns the result formatted in json.

You can specify the parameter as an accept header, instead of a query string. If both are present, the query string is used.

currency

The currency indicated here must match the designation field on the currency.                    

If an empty currency is passed with this parameter (or the parameter is not specified), it is interpreted as the key currency. For all other currencies, the values are read in the specified currency, if possible.

The endpoint returns results in the following format:

Header (column names)

Name of the requested measure (internal name). If the parameter is useDescriptions = true, the plain text designation of the measure is used instead of the internal name, and is returned translated according to the current language of the session.

Data row
  • Dimensional values
  • Object ID of dimensions (from Vertec 6.5.0.11): For each dimension value, there is a property with the same name and suffix _Id, which contains as the value the object ID of the dimension value: {"Bearbeiter":"Administrator","Bearbeiter_Id": 301,"Month":"2020-01-01", ...}. Month dimensions appear without the _Id-field in the result.
  • Measure values
 
Example of FTE query for the first quarter of 2023
api/bi/getdata?measures=fte&dimension0=Projektbearbeiter&useDescriptions=true&dimension1=month&startDate=2023-01-01&endDate=2023-03-31

Return:

"Bearbeiter","Bearbeiter_Id","Monat","Vollzeitstellen"
"Christoph Keller",676,"2023-01-01",0.8
"Christoph Keller",676,"2023-02-01",0.8
"Christoph Keller",676,"2023-03-01",0.8
"Judith Feller",682,"2023-01-01",1
"Judith Feller",682,"2023-02-01",1
...

/measures

The GET endpoint /measures returns all available measures.

The optional f parameter can be specified (see above).

The return includes the following fields:

  • Name
  • Description
  • Dimensions (string[] of class names)
  • Help text
  • Unit

The return values appear translated in the language that the user has set in the Vertec Web App.

Support for HTTP basic authentication

With Vertec version 6.6, API tokens were introduced to increase the login security of Web API accesses. Therefore, HTTP basic authentication with user name and password is no longer supported as of Vertec version 6.7.

  • The started session has a default timeout of 5 minutes. This can be done in the [Cloud Server] section Im Vertec ini file with XML Session Timeout = 5 (the BI API and the XML server share the session timeout setting).
  • After the timeout expires, the session is exited and the process disappears.
  • If, during this time, another request occurs with basic authentication and the same user, the session is reused.

If both the API token and user name/password are specified in a request, only the API token is considered. If it is invalid, a login attempt with user name/password is not made automatically.

Netherlands

United Kingdom