You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

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 describes call by call the flow that is traversed when using the Hospital DCM example project.

Call after starting up DCM

Endpoint: POST /api/v2/session/{sessionId}/load

Request: http://localhost:8080/server/api/v2/session/975b7516-6363-4b3a-a5aa-ee461f7ef481/load

Calls after clicking New >> Case


Endpoint: POST api/v2/session/{sessionId}/event

Requesthttp://localhost:8080/server/api/v2/session/975b7516-6363-4b3a-a5aa-ee461f7ef481/event

Request P784_Case_1
{
    "elementKey": "P784_Case_1",
    "fields": []
}
Response
{
    "events": [
        {
            "sessionId": "97e80378-9c5e-4257-9703-266fc60962cc",
            "type": "sessionClosed"
        },
        {
            "sessionId": "6cb4c524-4d70-46bf-b6a6-ddcb69b3b894",
            "type": "sessionClosed"
        },
        {
            "sessionId": "eb1735e6-c6e7-454a-99b5-af3c01d0d30f",
            "type": "page",
            "changes": {
                "changes": [
                	...
                    {
                        "key": "P784-C2-C1",
                        "model": {
                            "children": [],
                            "contentStyle": "dashboard_flowwidget",
                            "displayName": "New Case",
                            "key": "P784-C2-C1",
                            "name": "Widget_NewCase",
                            "properties": {
                                "info": "WidgetInfo_NewCaseWidget"
                            },
                            "styles": [],
                            "type": "container"
                        },
                        "type": "add"
                    },
                    ...
                ]
            }
        }
    ]
}


Endpoint: POST /api/v2/session/{sessionId}/widget/{infoKey}

Request: http://localhost:8080/server/api/v2/session/975b7516-6363-4b3a-a5aa-ee461f7ef481/widget/WidgetInfo_NewCaseWidget

Payload
{
    "elementKey": "P103_Case_1",
    "fields": []
}
Response
{"sessionId":"4eb58794-b0be-4d82-aaf0-32b5027022bd"}

Call after filling in postal code


Endpoint: POST api/v2/session/{sessionId}/event

Requesthttp://localhost:8080/server/api/v2/session/4eb58794-b0be-4d82-aaf0-32b5027022bd/event

Payload
{
    "elementKey": "P326_Address-Zipcode_1",
    "fields": [{
            "key": "P326_Address-NumberSuffix_1",
            "values": [""]
        }, {
            "key": "P326_Customer-Prefix_1",
            "values": [""]
        }, {
            "key": "P326_Address-Zipcode_1",
            "values": ["1234AB"]
        }, {
            "key": "P326_Address-Street_1",
            "values": ["Kerkstraat"]
        }, {
            "key": "P326_Customer-LastName_1",
            "values": ["Doe"]
        }, {
            "key": "P326_Customer-Gender_1",
            "values": ["f"]
        }, {
            "key": "P326_Address-Number_1",
            "values": ["1"]
        }, {
            "key": "P326_Customer-Initials_1",
            "values": ["J"]
        }, {
            "key": "P326_Customer-DateOfBirth_1",
            "values": ["2005-01-01"]
        }, {
            "key": "P326_Address-City_1",
            "values": [""]
        }, {
            "key": "P326_Customer-FirstName_1",
            "values": ["Jane"]
        }
    ]
}

Response
{
    "events": [{
            "sessionId": "4eb58794-b0be-4d82-aaf0-32b5027022bd",
            "changes": {
                "changes": [{
                        "type": "update",
                        "key": "P326_Address-Zipcode_1",
                        "model": {
                            "key": "P326_Address-Zipcode_1",
                            "name": "Address.Zipcode",
                            "properties": {},
                            "questionText": "Zip code",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": true,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["1234AB"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }, {
                                    "blocking": true,
                                    "type": "Regexp",
                                    "message": "Fill in a valid zipcode, without spaces",
                                    "parameters": {
                                        "posregexp": "^[0-9]{4}[a-z|A-Z]{2}$"
                                    }
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Address-Street_1",
                        "model": {
                            "key": "P326_Address-Street_1",
                            "name": "Address.Street",
                            "properties": {},
                            "questionText": "Street",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["Kerkstraat"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Customer-LastName_1",
                        "model": {
                            "key": "P326_Customer-LastName_1",
                            "name": "Customer.LastName",
                            "properties": {},
                            "questionText": "Last name",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["Doe"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Customer-Gender_1",
                        "model": {
                            "key": "P326_Customer-Gender_1",
                            "name": "Customer.Gender",
                            "properties": {},
                            "questionText": "Gender",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": true,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [{
                                    "displayValue": "Male",
                                    "value": "m"
                                }, {
                                    "displayValue": "Female",
                                    "value": "f"
                                }
                            ],
                            "messages": [],
                            "values": ["f"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": ["options_horizontal"]
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Address-Number_1",
                        "model": {
                            "key": "P326_Address-Number_1",
                            "name": "Address.Number",
                            "properties": {},
                            "questionText": "Number",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["1"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Customer-Initials_1",
                        "model": {
                            "key": "P326_Customer-Initials_1",
                            "name": "Customer.Initials",
                            "properties": {},
                            "questionText": "Initials",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["J"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Customer-DateOfBirth_1",
                        "model": {
                            "key": "P326_Customer-DateOfBirth_1",
                            "name": "Customer.DateOfBirth",
                            "properties": {},
                            "questionText": "Date of birth",
                            "explainText": null,
                            "dataType": "date",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": true,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["2005-01-01"],
                            "validations": [{
                                    "blocking": true,
                                    "type": "Required",
                                    "message": "This is a required field.",
                                    "parameters": {}
                                }
                            ],
                            "type": "field",
                            "styles": []
                        }
                    }, {
                        "type": "update",
                        "key": "P326_Customer-FirstName_1",
                        "model": {
                            "key": "P326_Customer-FirstName_1",
                            "name": "Customer.FirstName",
                            "properties": {},
                            "questionText": "First name",
                            "explainText": null,
                            "dataType": "text",
                            "rejectedValue": null,
                            "readonly": false,
                            "required": false,
                            "hasDomain": false,
                            "multiValued": false,
                            "refresh": false,
                            "displayLength": -1,
                            "domain": [],
                            "messages": [],
                            "values": ["Jane"],
                            "validations": [],
                            "type": "field",
                            "styles": []
                        }
                    }
                ]
            },
            "type": "page"
        }
    ]
}