Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Description

Logout the current user and close all Blueriq sessions

Response

204 No Content



Starting a Blueriq session

Start Shortcut

Code Block
POST /api/v2/start/{shortcutName?}

Description


Starts a session by specifying the name of a shortcut.

 

Parameters

URL SegmentExpected TypeDescription
shortcutNamestring

The shortcut name, leave empty to start the default shortcut

 

Example response

Code Block
{
    "sessionId": "2f177274-514d-4be9-aa3d-4a550ab9e724",
    "sessionTimeout": 1800
}

 


Start Project

Code Block
POST /api/v2/start?project=export-kinderbijslag&flow=Main

Description

Starts a session with project parameters. This endpoint may be disabled in production for security reasons, so using shortcuts is preferred.

 

Parameters

Query parameterExpected TypeDescriptionRequired
projectstring

The project to start

Yes

flow

stringThe flow to startOnly required if more than one exposed flow is present in the project
versionstringThe branch versionNo
languageCodestringThe project languageNo
uistringThe UI variant to use, by default only mvc and xslt is supportedNo
themestringThe project themeNo
channelstringthe project channelNo

Example response

Code Block
{
    "sessionId": "2f177274-514d-4be9-aa3d-4a550ab9e724",
    "sessionTimeout": 1800
}


Interacting with a session 

In Blueriq, each session is part of (usually) one subscription in order to allow receiving changes from multiple Blueriq sessions simultaneously. 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) for each session that is attached to the subscription. 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:

...

Description

Loads the information of the provided session and registers the session with the specified subscriptionId.

Example response

Code Block
languagetext
 {
   "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"
   }
 }

 

...

Description

Handles a page event and returns the events that occurred in any of the sessions in the subscriptionheirarchy.

Parameters

URL SegmentExpected TypeDescription
sessionIdstringThe session id.

 

 

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
languagejs
{
	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
languagetext
titleExample request
{
	"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.

 

Code Block
languagejs
{
    events: { EventResponse }[]
}
Code Block
languagetext
titleExample response
{
   "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"
	}]
}

 

...

Description

Starts a flow and returns the events that occurred in any of the sessions in the subscriptionhierarchy.

Example response

Code Block
languagetext
{
	"events": [{
		"sessionId": "7c2868f4-4fe9-48b6-841a-cf3e4831750a",
		"changes": {
			"changes": [{
				"type": "delete",
				"key": "P977-C1",
				"model": null
			}]
		},
		"type": "page"
	}]
}

 

...