Versions Compared

Key

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

...

Login user

Code Block
languagejs
POST /api/v2/login

Description

Log Login the user in with the provided credentials

Parameters

Query
ParameterExpected TypeDescription
usernamestringUsername of the user to login.
passwordstringPassword of the user to login.
UI Text Box
typenote

Before release 12.10, Blueriq expected the username and password to be in the request parameters of the login request. Since 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.

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:

Code Block
languagejs
titleapp.module.ts
    V2BackendModule.forRoot({
      baseUrl: ....,
      legacyLoginWithQueryParams: true,
    }),

Request body

Code Block
languagejs
{
	"username": string,
	"password": string
}


Example Request Url

Code Block
languagejs
/api/v2/login?username=<username>&password=<password>

Response

204 No Content, if successful.

401 Unauthorized, if unsuccessful.

...

Description

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

Headers

NameValue
Content-Typeapplication/json


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 V1.

 

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"
	}]
}


...