REST API service

  • Updated

All data from Perfion can be queried via two different endpoints. The endpoints differ in their input methods. The response of both endpoints is the same.

The syntax of the JSON formatted response data is described in the Query Reference.

 

POST Data endpoint

This endpoint accepts a Perfion JSON query and queries the Perfion Database for data.

Url: POST /data

Parameters:

Parameter Description Properties
string query

JSON formatted search.

The Perfion Query JSON is separated into the sections: Select, From, Where, Having and Order.

The syntax is inspired by normal SQL and should therefore be easy to learn.

Content type: application/json

Parameter type: Body

As input, the method takes a Perfion Query in JSON format. The syntax is inspired by normal SQL but is enhanced with the ability to return multi-valued and sequenced data as well as localized data in multiple languages, and a number of other advanced abilities not possible with the regular SQL tabular result format.

The method returns all data in JSON format. For binary features such as images and files, the binaryID GUID value is returned. The actual Binary data can then be retrieved via the File & Image Server included in the Perfion API service.

Authentication:

The endpoint requires authentication. The token is a JWT bearer token. Please refer to Authentication to learn how to get a token.

The token must be supplied in the request header. In C# it can be done on a HttpClient like this:

The endpoint will respond with the following response codes

Response code 200 (OK)

The request was successful. The response body is a JSON object. Read more about the format in Query Reference

Response code 400 (Bad request)

Given parameters was missing or invalid. The response body contains is a JSON object formatted in one of the following ways:

Response code 401 (Unauthorized)

No valid authentication token was supplied!

Response code 500 (Internal server error)

Some unexpected error has occurred. The response body contains is a JSON object formatted as follows:

 

GET Data endpoint

This endpoint excepts an ID reference of a search feature item and executes the Perfion query that is saved on it.

Url: Get /data?searchId=123&index=0&maxCount=5 

Parameters:

Parameter Description Properties
int searchId Represents the identifier for a feature data item placed under a search feature. Parameter type: query
int index Optional parameter that injects page index into the saved Perfion query to give control of paging. Parameter type: query
int maxCount Optional parameter that injects page max count into the saved Perfion query to give control of paging. Parameter type: query

The method returns all data in JSON format. For binary features such as images and files, the binaryID GUID value is returned. The actual Binary data can then be retrieved via the File & Image Server included in the Perfion API service.

Authentication:

The endpoint requires authentication. The token is a JWT bearer token. Please refer to Authentication to learn how to get a token.

The token must be supplied in the request header. In C# it can be done on a HttpClient like this:

The endpoint will respond with the following response codes

Response code 200 (OK)

The request was successful. The response body contains is a JSON object formatted as follows.

Response code 400 (Bad request)

Given parameters was missing or invalid. The response body contains is a JSON object formatted in one of the following ways:

Response code 401 (Unauthorized)

No valid authentication token was supplied!                           

Response code 500 (Internal server error)

Some unexpected error has occurred. The response body contains is a JSON object formatted as follows:

 

GET Audit Logs endpoint

The audit logs endpoint makes it possible to retrieve audit events recorded by the system within a specified date range.

Audit logs are retrieved using a request resembling:

http://ServiceHostName/audit-logs?from=2026-05-01&to=2026-05-12

The endpoint requires authentication and authorization before data is returned. If the request is not authenticated, the service may respond with 401 Unauthorized. If the request is authenticated but the caller does not have the required permissions, the service may respond with 403 Forbidden.

A required role must also be configured in the user interface before this endpoint responds successfully.

Parameters:

Para-meter Description Example
from The from parameter specifies the start date of the audit log interval. This parameter is required. http://ServiceHostName/audit-logs?from=2026-05-01&to=2026-05-12
to The to parameter specifies the end date of the audit log interval. This parameter is required. http://ServiceHostName/audit-logs?from=2026-05-01&to=2026-05-12

Response

A successful request returns audit log entries in JSON format:

[
  {
    "userId": "Admin",
    "timestampUtc": "2026-05-12T06:13:49.9733333+00:00",
    "event": "login",
    "interface": "PerfionApi",
    "source": "::1"
  }
]

The entries provided are as follow.

Entry Description
userId Specifies the user related to the recorded event. In some cases, this field may contain a descriptive message rather than a user identifier.
timestampUtc Specifies when the audit event occurred, expressed in UTC.
event Specifies the type of audit event that was recorded.
interface Specifies which interface the action originated from.
source Specifies the source of the recorded event.

Authorization

The endpoint requires the caller to be authenticated and to have the necessary role assigned. Without authentication the service may return 401. Without the required authorization or UI role configuration the service may return 403.

 

POST Get Version endpoint

This endpoint return the version number.

Url: GET /get-version

Parameters: no parameters needed

Authentication:

The endpoint requires authentication. The token is a JWT bearer token. Please refer to Authentication to learn how to get a token.

The token must be supplied in the request header. In C# it can be done on a HttpClient like this:

The endpoint will respond with the following response codes

Response code 200 (OK)

The request was successful. The response body is a JSON object.

{
  "Version": "5.2.0"
}

Response code 400 (Bad request)

Given parameters was missing or invalid.

Response code 401 (Unauthorized)

No valid authentication token was supplied!

Response code 500 (Internal server error)

Some unexpected error has occurred. The response body contains is a JSON object formatted as follows:

 

POST Execute Action endpoint

This endpoint execute an action and return an execution Id.

Url: POST /execute-action/{actionId}

Parameters:

Parameter Description Properties
int actionId Action Id to be executed

Content type: application/json

Parameter type: URI

string actionInput

JSON formatted table.

{
"ActionInput": {
"ActionTable1": [
{
"Col1": "123",
"Col2": "456"
},
{
"Col1": "123",
"Col3": "456"
}
],
"ActionTable2": {
"Col1": "123",
"Col2": "456"
}
}
}

Content type: application/json

Parameter type: Body

Authentication:

The endpoint requires authentication. The token is a JWT bearer token. Please refer to Authentication to learn how to get a token.

The token must be supplied in the request header. In C# it can be done on a HttpClient like this:

The endpoint will respond with the following response codes

Response code 200 (OK)

The request was successful. The response body is a JSON object.

{
"ExecutionQueueId": 19
}

Response code 400 (Bad request)

Given parameters was missing or invalid.

Response code 401 (Unauthorized)

No valid authentication token was supplied!

Response code 500 (Internal server error)

Some unexpected error has occurred. The response body contains is a JSON object formatted as follows:

 

POST Process report endpoint

This endpoint processes a report and return the processed report.

Available from Perfion 2023 R1 SR1.

Url: POST /reports/{reportId}/process?id=3027&language=dan&streamtype=pdf

Parameters:

Parameter Description Properties
int reportId Report Id to be processed. Parameter type: URI
int id Id of item or items to be included in the report. Can be comma separated list of id’s if multiple items is to be included. Parameter type: URI
string language Language to generate report in. This is an optional parameter. Parameter type: URI
string streamtype

Report can be generated in the following formats:

  • Pdf
  • Html
  • Mht
  • Rtf
  • Xls
  • Xlsx
  • Csv
  • Text
  • AddInOutput

This is an optional parameter.

Parameter type: URI
string action The action parameter work for reports as described for Media Services URL Parameters. This is an optional parameter. Parameter type: URI
string parameters

JSON formatted array of report parameters as specified in the superquery of the report. This is an optional parameter.

[

{"id":'StringTestParam',"values":['Testing']},

{"id":'IntTestParam',"values":['123']},

{"id":'DateTestParam',"values":['2022-12-01']},

{"id":'SelectTestParam',"values":['3593']},

{"id":'MultiTestParam',"values":['1st value','2nd value']}

]

Content type: application/json

Parameter type: Body

Authentication:

The endpoint requires authentication. The token is a JWT bearer token. Please refer to Authentication to learn how to get a token.

The token must be supplied in the request header. In C# it can be done on a HttpClient like this:

The endpoint will respond with the following response codes

Response code 200 (OK)

The request was successful. The response body is a streamed report file.

Response code 400 (Bad request)

Given parameters was missing or invalid.

Response code 401 (Unauthorized)

No valid authentication token was supplied!

Response code 500 (Internal server error)

Some unexpected error has occurred.

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.