Skip to content

Profinity V2 IS NOW IN EARLY ADOPTER RELEASE

Profinity V2 is available now in Early Adopter Release. To support this release we are making the documentation public. To get access to the Profinity V2 installers, please log a support request at the Prohelion Support Portal requesting access to the Early Adopter release.

Profinity Rest APIs

Profinity V2 is a fully API native application with a modern architecture. It supports API security and an open interface model based around REST & JSON. This allows you to build custom application using the Profinity APIs to provide additional capabilities to your solutions, Custom User Interfaces or just extend the out of the box functionality to meet your needs.

As well as supporting Restful APIs, Profinity's overall solution allows you to build completely custom User Interfaces based on Profinity and host those interfaces either externally or within the Profinity solution.

Important Information Regarding Profinity Rest APIs

Prohelions API solution is currently evolving rapidly as we develop new capabilities. Please be aware of this when developing solutions based on Profinity's APIs, as available APIs and models may evolve rapidly from release to release.

Profinity APIs are Powerful

While our APIs support security and can be encrypted, be aware that by using Profinity's APIs you need to be careful with what power you are proving the user to ensure that they do not accidentally damage your environment or equipment.

Using Profinity APIs

Profinity V2 itself is built around our APIs so as of V2 all APIs are running all the time.

To see the Swagger interface for Profinity, simply go to the URL that Profinity is running on and add /swagger, so for example if Profinity is running on localhost:18080, then http://localhost:18080/swagger, should take you to the Swagger UI.

Showing the Profinity APIs

Showing the Profinity APIs


Profinity API Security

To use Swagger calls in the GUI, you will need to generate and then provide your Bearer token to the API's if you wish to test them using Swagger. To generate the Bearer token, in the Swagger GUI execute a call against the /Users/Authenticate API and then apply the returned Bearer token by clicking on the Authorise button in the top right of the Swagger API.

To get a security token call a Profinity instance on the /users/authenticate endpoint with a POST request containing the username and password you wish to adopt for your API usage as the JSON body. For example

Post request on http://localhost:18080/users/authenticate

{
  "username": "admin",
  "password": "password"
}

HTTPs is required for password security

Note that calling this API on a http connection does leave you exposed to network scanning which could expose your password. For custom applications running on the Profinity server the localhost address can be used that does not expose this risk. If your application is calling Profinity across a network, we would recommend https for API usage.

Profinity will respond to this request if your username and password are valid with a security token like this

{
    "token": "eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzm9yZy93cy8yMDA1LzA1kZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOlsiQWRtaW4iLCJTeXN0ZW1SZWFkIiwiU3lzdGVtVXBkYXRlIiwiQ2d32thhcmdpbmciLCJDYW5Tdd1ZW5kUmVjZWl2ZSJdLCJleHAiOjE3NDUwNzkzOTAsImlzcyI6Ind3dy5wcm9oZWxpb24uY29tIiwiYXVkIjoid3d3LnByb2hlbGlvbi5jb20ifQ.9abNWiI32gNOaNHNvdMnIGCRHyRc7tExeVZlYtAm4r0"
}

Generating a Authorization token via Swagger

Generating a Authorization token via Swagger


The contents of this token should then be passed in each subsequent request as a Bearer Token, check the documentation of your client side tools to determine how best to achieve this with the tool you are using to call Profinity.

In Swagger this token is applied by using the Authorize button in the top right of the screen and pasting in the token you have generated

Entering the token in Swagger

Entering the token in Swagger


Accessing Historical Data via APIs

APIs can provide both realtime and historical data, when a InfluxDB database is configured in the profile. If no InfluxDB is setup, then only realtime data is available.

The /api/v2/CAN/{Message}/{Signal} api is used to get historical data. To use this API request a DBC Message and Signal as well as a InfluxDB time range that you wish to retrieve the data for. The API will then call InfluxDB and retrieve all of the data stored across that time frame for this signal.

For more information on configuring InfluxDB see the InfluxDB and Prometheus Integration section of this documentation.