Page History
...
Info | ||
---|---|---|
| ||
The serialization of page element to datamodel is handled by the |
Create subscription
In Blueriq, a "subscription" is used for bundling multiple sessions together in order for all their events to be published together, which is useful for DCM application where task widgets have their own session, but participate in the main Blueriq session. A subscription is required even if only a single session is used.
When using one of the /api/v1/start
endpoints, a subscription with id equal to the sessionId has already been created, so usually there is no need to create a subscription manually yourself. It is however possible to create your own subscription through a POST
to /api/v1/subscription/{subscriptionId}/create
, providing the ID of the subscription to be created.
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/create |
...
Description
Creates a subscription to which sessions can subscribe. The specified subscription ID may be chosen freely and will be the identifier of the created subscription.
Parameters
Response
204 No Content
Load session information
After a session has been created using /api/v1/start
, the current state of the session can be obtained through:
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/load |
Description
Loads the information of the provided session and registers the session with the specified subscriptionId.
Example response
Code Block | ||
---|---|---|
| ||
{ "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" } } |
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The id of the session. |
subscriptionId | string | The subscription id the session is part of. |
...
Send user event
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/event |
Description
Headers
Name | Value |
---|---|
Content-Type | application/json |
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
subscriptionId | string | The subscription id the session is part of. |
Request body
At least the element that triggered the event and all editable fields on the page must be included in the request.
Code Block | ||
---|---|---|
| ||
{ 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 } |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "elementKey": "P960-C2-B1", "fields": [ { "key": "P960-C1-F0", "values": [ "testValue" ] }, { "key": "P960-C1-F6", "values": [ "testValue2" ] } ] } |
Response body
Returns an event response, for more info about an event response see: REST Events V1.
Code Block | ||
---|---|---|
| ||
{ events: { EventResponse }[] } |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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" }] } |
...
Start flow
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/flow/{flowName} |
Description
Starts a flow and returns the events that occurred in any of the sessions in the subscription. When a page is currently active, only flows which have already been visited can be started.Example response
Code Block | ||
---|---|---|
| ||
{ "events": [{ "sessionId": "7c2868f4-4fe9-48b6-841a-cf3e4831750a", "changes": { "changes": [{ "type": "delete", "key": "P977-C1", "model": null }] }, "type": "page" }] } |
Parameters
URL Segment | Expected Type | Description |
---|---|---|
sessionId | string | The session id. |
subscriptionId | string | The subscription id the session is part of. |
flowName | string | The name of the flow. |
...
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/close |
Description
Closes a session and all its child session.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The sessionId |
Keep alive
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/keepalive |
Description
Assures that the session stays alive by refreshing its most recent access date.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The session id. |
Response
204 No Content
Create widget
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/widget/{infoKey} |
Description
provides a service that creates a child-session using the provided sessionId as its parent, to be used for widgets.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
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 |
Reponse
The sessionId of the existing or newly created session.
Code Block | ||
---|---|---|
| ||
{"sessionId":"a487f65e-6804-4803-bf4b-c89e45f97e38"} |
Handling files
Endpoints that go with AQ_File_Upload/AQ_File_Download containers.
Upload file
Code Block | ||
---|---|---|
| ||
POST /api/v1/subscription/{subscriptionId}/session/{sessionId}/file/{configurationId}/upload |
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The session id. |
configurationId | string | The configuration id. |
Response body
Returns an event response, for more info about an event response see: REST Events V1.
Download a file
Code Block | ||
---|---|---|
| ||
GET /api/v1/subscription/{subscriptionId}/session/{sessionId}/file/{configurationId}/download |
Description
Gets the file from the specified connection based on its configuration
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The session id |
configurationId | string | The property configuration id, available |
Example response
The requested file, transferred using Content-Disposition: attachment
.
Check authorization
Code Block |
---|
GET /api/v1/subscription/{subscriptionId}/session/{sessionId}/file/{configurationId}/checkauthorization |
Description
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The session id |
configurationId | string | The configuration id |
Example response
200 OK, if the current user is authorized to download the file
401 Unauthorized, otherwise
Documents
Use to render a Blueriq document or page. A call to this service returns the binary data of the document or page.
Render a document
Code Block | ||
---|---|---|
| ||
GET /api/v1/subscription/{subscriptionId}/session/{sessionId}/document/{documentName}/{type} |
Description
Renders a document and returns its binary value.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The id of the session. |
documentName | string | Name of the document. |
type | string | Type of document (e.g. PDF). |
Response body
Transfers the binary data of a document using Content-Disposition: attachment
Render a page
Code Block | ||
---|---|---|
| ||
GET /api/v1/subscription/{subscriptionId}/session/{sessionId}/document/page/{pageName}/{type} |
Description
Renders a page and returns its binary value.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The id of the session. |
pageName | string | Name of the page. |
type | string | Type of page (e.g. PDF). |
Response body
Transfers the binary data of a page using Content-Disposition: attachment
Images
Retrieve an image
Code Block | ||
---|---|---|
| ||
GET api/v1/subscription/{subscriptionId}/session/{sessionId}/image/{imageName} |
Description
Returns the binary data of a named Blueriq image.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The id of the session. |
imageName | string | The name of the image. |
Response body
Returns the binary data of an image.
Retrieve a QR Code image
Code Block | ||
---|---|---|
| ||
GET api/v1/subscription/{subscriptionId}/session/{sessionId}/image/{imageName}/key/{key} |
Description
Returns the binary data of a named Blueriq QR Code image.
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The id of the session. |
imageName | string | The name of the image. |
key | string | the element key. |
Response body
The binary data of an image.
Offline functionality
Prepare offline task
Code Block |
---|
POST api/v1/subscription/{subscriptionId}/session/{sessionId}/offline/prepare/{taskId} |
Description
Prepares a task to be executed in offline mode
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of. |
sessionId | string | The session id. |
taskId | string | The id of the task to prepare offline mode for |
Response body
A PageModel instance with the page contents started by the task. For more information about the page contents (elements) see: REST Page Models V1.
Inference details
The DMN service is part of the development plugin and can be used to get inference details for attribute instances
Get Decision Tree
Code Block | ||
---|---|---|
| ||
GET /api/v1/subscription/{subscriptionId}/session/{sessionId}/dmn/{entityName}/{instanceId}/{attributeName} |
Description
Gets a decision tree model for the specified attribute instance
Parameters
URL Segment | Expected Type | Description |
---|---|---|
subscriptionId | string | The subscription id the session is part of |
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 |
Example response
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.
Code Block | ||
---|---|---|
| ||
{ "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" } } |
Language
Get current languages
Code Block |
---|
GET /api/v1/session/{sessionId}/language |
Description
Returns a status code 200 if request was successful and a body containing a JSON Array with the available languages.
Example response
Code Block |
---|
[ { "code": "nl-NL", "name": "Nederlands" }, { "code": "en-US", "name": "English" } ] |
Set language
Code Block |
---|
POST /api/v1/session/{sessionId}/language/current?languageCode=nl-NL |
Description
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.
Standard response codes
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 V1.