The Blueriq web application is equipped with a REST API to expose methods to allow clients to control the flowing of the application. This page gives a description about the available services. For all of the below endpoints, an Accept
header of application/json
must be present in the request.
POST /api/v2/login |
Description
Login the user with the provided credentials
{ username: string, password: string } |
{ "username": "testUser", "password": "secret" } |
Before release 12.10, Blueriq expected the username and password to be in the request parameters of the login request (e.g. http://.../api/v2/login?username=testUser&password=secret). Since release 12.10, the username and password are retrieved from the login request body. For backwards compatibility the login information can still be retrieved from the request parameters as well. The material theme sends the login information in the request body by default from release 12.10. It is possible to configure the theme to still use the legacy request parameter method of logging in, by configuring the backend module in your theme:
|
204 No Content, if successful.
401 Unauthorized, if unsuccessful.
POST /api/v2/logout |
Query Parameter | Expected Type | Description | Required |
---|---|---|---|
redirect_uri | string | URL to redirect to after logout | Conditional (see Response) |
Logout the current user and close all Blueriq sessions
204 No Content
302 Found
400 Bad Request
POST /api/v2/start/{shortcutName?} |
Starts a session by specifying the name of a shortcut.
URL Segment | Expected Type | Description |
---|---|---|
shortcutName | string | The shortcut name, leave empty to start the default shortcut |
{ "sessionId": "2f177274-514d-4be9-aa3d-4a550ab9e724", "sessionTimeout": 1800 } |
POST /api/v2/start?project=export-kinderbijslag&flow=Main |
Query parameter | Expected Type | Description | Required |
---|---|---|---|
project | string | The project to start | Yes |
flow | string | The flow to start | Only required if more than one exposed flow is present in the project |
version | string | The branch version | No |
languageCode | string | The project language | No |
ui | string | The UI variant to use, by default only mvc is supported | No |
theme | string | The project theme | No |
channel | string | the project channel | No |
{ "sessionId": "2f177274-514d-4be9-aa3d-4a550ab9e724", "sessionTimeout": 1800 } |
After having started a session using one of the /api/v2/start
endpoints, its initial page contents may be obtained via a POST
to /api/v2/session/{sessionId}/load
. The result of this call is the full page model, necessary for initial rendering of the page. Subsequently, events may be submitted to the runtime via a POST
to /api/v2/session/{sessionId}/event
, resulting in a response containing all changes (add, update, delete). In Blueriq each session may be part of a hierarchy of sessions. For example, in a DCM application, the session of a flow widget is a child session of the main dashboard session. An event in one session may cause changes in other sessions if Portal Messages are thrown. Therefore, the response of /api/v2/session{sessionId}/event
endpoint will contain changes in all sessions in the heirarchy. An example response containing the changes:
{"events":[ {"sessionId":"27390ee2-4968-4f27-ae71-3d6516ba06ec", "changes": { "changes":[ {"type":"add", "key":"P521-C0-F1", "model":{ "key":"P521-C0-F1", "name":"e.a2", "properties":{}, "questionText":"q2", "explainText":null, "dataType":"boolean", "rejectedValue":null, "readonly":false, "required":false, "hasDomain":false, "multiValued":false, "refresh":false, "displayLength":-1, "domain":[], "messages":[], "values":[], "type":"field", "styles":[] } } ] } ]} |
In this example a field is added to the page. The available properties per element are listed in the REST Page Models.
The serialization of page element to datamodel is handled by the |
After a session has been created using /api/v2/start
, the current state of the session can be obtained through:
POST /api/v2/session/{sessionId}/load |
Loads the information of the provided session.
{ "elements": [ { "key": "P381-C1", "name": "Single", "properties": { }, "children": [ "P381-C1-F0", "P381-C1-F1", "P381-C1-F7" ], "displayName": "Single Items", "contentStyle": "container", "type": "container", "styles": [ ] } ], "language": { "patterns": { "datetime": "yyyy-mm-dd hh:mm:ss", "date": "yyyy-mm-dd" }, "languageCode": "en-GB" } } |
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
Contains a description of the current page model and language settings. For more information about the page elements see REST Page Models.
{ language { languageCode: string, // Current language of the session patterns: { [string]: string }, // Formatter patterns for dates }, // Language information of the session elements [{ type: string, key: string, name: string, styles: string[], properties: { [string]: string }, }] // All elements of the currently active Blueriq page. Further explained under 'REST Page Models' } |
POST /api/v2/session/{sessionId}/event |
Name | Value |
---|---|
Content-Type | application/json |
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
At least the element that triggered the event and all editable fields on the page must be included in the request.
{ elementKey: string, // Key of the element the event originates from fields: [{ key: string, // Key of the field values: string[], // Values of the field, an array even if the field is not multivalued }], // Data of all fields on the page parameters: { [string]: string } // Additional parameters that may be passed to the backend } |
{ "elementKey": "P960-C2-B1", "fields": [ { "key": "P960-C1-F0", "values": [ "testValue" ] }, { "key": "P960-C1-F6", "values": [ "testValue2" ] } ] } |
Returns an event response, for more info about an event response see: REST Events.
{ events: { EventResponse }[] } |
{ "events": [{ "sessionId": "45992123-f893-4b22-a6a3-ff648b63267c", "changes": { "changes": [ { "type": "add", "key": "P501-C1-B0", "model": { "key": "P501-C1-B0", "name": "Annuleer", "properties": { }, "disabled": false, "refresh": false, "caption": "Annuleer", "type": "button", "styles": [ ] } }, }, "type": "page" }] } |
POST /api/v2/session/{sessionId}/flow/{flowName} |
{ "events": [{ "sessionId": "7c2868f4-4fe9-48b6-841a-cf3e4831750a", "changes": { "changes": [{ "type": "delete", "key": "P977-C1", "model": null }] }, "type": "page" }] } |
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
flowName | string | The name of the flow. |
Returns an event response, for more info about an event response see: REST Events V1.
POST /api/v2/session/{sessionId}/close |
Closes a session and all its child session.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The sessionId |
204 No Content
POST /api/v2/session/{sessionId}/keepalive |
Assures that the session stays alive by refreshing its most recent access date.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
204 No Content
POST /api/v2/session/{sessionId}/widget/{infoKey} |
provides a service that creates a child-session using the provided sessionId as its parent, to be used for widgets.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id |
infoKey | string | The info key of the widget to load, available in properties.info of a page mode of type dashboard_flowwidget |
The sessionId of the existing or newly created session.
{"sessionId":"a487f65e-6804-4803-bf4b-c89e45f97e38"} |
Starting an external flow consists of multiple calls.
POST /api/v2/session/{sessionId}/externalflow/init |
{"configurationId":"fd308ecf-bf93-4061-bbc7-7cace2cde764","baseUrl":""} |
provides a service that initializes an external flow starting from your current session.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id |
configurationId | string | The info key of the widget to load, available in properties.configurationId of a page model of type external_flow |
{"configurationId":"fd308ecf-bf93-4061-bbc7-7cace2cde764","baseUrl":""} |
POST /api/v2/externalflow/start |
{"configurationId":"fd308ecf-bf93-4061-bbc7-7cace2cde764"} |
provides a service that creates a child-session, to be used for widgets.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id |
configurationId | string | The info key of the widget to load, available in properties.configurationId of a page model of type external_flow |
The sessionId of the existing or newly created session. After starting a session its initial page contents may be obtained via a POST
to /api/v2/session/{sessionId}/load
.
{"sessionId":"9f79ac63-f994-4b9e-8a4d-86ef5a561291"} |
Endpoints that go with AQ_File_Upload/AQ_File_Download containers.
POST /api/v2/session/{sessionId}/file/{configurationId}/upload |
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
configurationId | string | The configuration id. |
Returns an event response, for more info about an event response see: REST Events V1.
GET /api/v2/session/{sessionId}/file/{configurationId}/download |
Gets the file from the specified connection based on its configuration
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id |
configurationId | string | The property configuration id, available |
Query Parameter | Expected Type | Description |
---|---|---|
error-redirect | string | Optional. Specifies the URL to be redirected to if the file download fails. If not provided, the default JSON error output will be used instead. |
Example response
The requested file, transferred using Content-Disposition: attachment
.
GET /api/v2/session/{sessionId}/file/{configurationId}/checkauthorization |
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id |
configurationId | string | The configuration id |
200 OK, if the current user is authorized to download the file
401 Unauthorized, otherwise
Use to render a Blueriq document or page. A call to this service returns the binary data of the document or page.
GET /api/v2/session/{sessionId}/document/{documentName}/{type} |
Renders a document and returns its binary value.
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
documentName | string | Name of the document. |
type | string | Type of document (e.g. PDF). |
Query Parameter | Expected Type | Description |
---|---|---|
error-redirect | string | Optional. Specifies the URL to be redirected to if the document download fails. If not provided, the default JSON error output will be used instead. |
Transfers the binary data of a document using Content-Disposition: attachment
GET /api/v2/session/{sessionId}/document/page/{pageName}/{type} |
Description
Renders a page and returns its binary value.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
pageName | string | Name of the page. |
type | string | Type of page (e.g. PDF). |
Query Parameter | Expected Type | Description |
---|---|---|
error-redirect | string | Optional. Specifies the URL to be redirected to if the document download fails. If not provided, the default JSON error output will be used instead. |
Response body
Transfers the binary data of a page using Content-Disposition: attachment
GET api/v2/session/{sessionId}/image/{imageName} |
Description
Returns the binary data of a named Blueriq image.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
imageName | string | The name of the image. |
Response body
Returns the binary data of an image.
GET api/v2/session/{sessionId}/image/{imageName}/key/{key} |
Returns the binary data of a named Blueriq QR Code image.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
imageName | string | The name of the image. |
key | string | The element key of the image. |
Response body
The binary data of an image.
The DMN service is part of the development plugin and can be used to get inference details for attribute instances
Get Decision Tree
GET /api/v2/session/{sessionId}/dmn/{entityName}/{instanceId}/{attributeName} |
Gets a decision tree model for the specified attribute instance
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id to create an event response for |
entityName | string | Entity name for the attribute for which the decision tree is requested |
instanceId | string | Instance id for the attribute for which the decision tree is requested |
attributeName | string | Name of the attribute for which the decision tree is requested |
A decision tree for DMN starts with a rootNode and it is possible that there are 0 or more usedDecisions. A used decision describes an attribute that is used to derive the parent attribute.
{ "rootNode": { "ruleName": "DMNEntity.DataRuleEndResult", "justification": null, "usedDecisions": [ { "ruleName": "DataRuleForPage", "justification": null, "usedDecisions": [], "entityName": "DMNEntity", "attributeName": "DataRule", "attributeValues": [ "44" ], "sourceType": "System", "defaultRuleType": null, "instanceId": "40c05cc5-8ddf-48a3-8d5d-53228ca7305c" } ], "entityName": "DMNEntity", "attributeName": "DataRuleEndResult", "attributeValues": [ "1342" ], "sourceType": "Default", "defaultRuleType": "expression", "instanceId": "40c05cc5-8ddf-48a3-8d5d-53228ca7305c" } } |
GET /api/v2/session/{sessionId}/language |
Returns a status code 200 if request was successful and a body containing a JSON Array with the available languages that are available in the current project.
[ { "code": "nl-NL", "name": "Nederlands" }, { "code": "en-US", "name": "English" } ] |
POST /api/v2/session/{sessionId}/language/current?languageCode=nl-NL |
Sets the specified language in the languageCode parameter for the currently active project. If the specified language does not exist a Bad Request status code is returned.
All services return a 200 response code on successful requests and a 500 response code if an error occurs. For more information about errors see REST Errors V2.