Skip to main content

Forms API

Content

This guide provides information on how to interact with the Forms REST API of Bloom Enterprise.

How to use it?

ItemValue
BASE_URIhttp://SERVER_IP/restapi/v2/
RESPONSE_FORMATJSON
Attention

If the integration you are trying to develop will require pooling Bloom Enterprise’s REST API, you should use WebSockets instead. Please contact Q-Better’s team to know more details.

Forms Templates

List Existing Forms Templates

ItemValue
NameList Existing Forms Templates
URLBASE_URI/forms
HTTP MethodGET
Response DataFetches the list of existing forms templates

Responde Example

JSON
{
"success": boolean,
"forms": [
{
"id": string,
"name": string,
"questions": {
"before": [{
"id": string,
"selected" : boolean,
"question": string,
"expanded": boolean,
"anonymize": boolean,
"anonymize_in_days": int,
"visible_on": {
"ticket_kiosks": boolean,
"virtual_ticket": boolean,
"appointments": boolean,
"concierge": boolean,
"extender": boolean,
"qm_pad": boolean,
"card_reader": boolean,
"eticket": boolean
},
"staff_permissions": {
"visible": boolean,
"editable": boolean
},
"depends_on": {
"has_dependency": boolean,
"question": string,
"answer": string
},
"config": string,
"qat_id": string,
"required": boolean
}],
"during": [{ ... }],
"end": [{ ... }]
},
},
{...}],
"fields": [
[
"id": string,
"name": string,
"type": int,
"config": {
"mask": int,
"length": string
},
"permanent": boolean,
"expanded": boolean,
"selected": boolean
],
{...}
]
}

Detail Form Template

ItemValue
NameDetails Form Template
URLBASE_URI/forms/form_id
HTTP MethodGET
Response DataReturns the details of a specific form template

Request options

ItemValue
form_idNeeds to be a UUID string.

Responde Example

JSON
{
"success": boolean
"role": {
"id": string,
"name": string,
"selected": boolean,
"questions": {
"before": {
"1": {
"id": string,
"selected": boolean,
"question": string,
"expanded": boolean,
"anonymize": boolean,
"anonymize_in_days": int,
"visible_on": {
"ticket_kiosks": boolean,
"virtual_ticket": boolean,
"appointments": boolean,
"concierge": boolean,
"extender": boolean,
"qm_pad": boolean,
"card_reader": boolean,
"eticket": boolean
},
"staff_permissions": {
"visible": boolean,
"editable": boolean
},
"depends_on": {
"has_dependency": boolean,
"question": string,
"answer": string
},
"config": string,
"qat_id": string,
"required": boolean
},
{...}
},
"during": [],
"end": []
}
}
}

Create Form Template

ItemValue
NameCreate form template
URLBASE_URI/forms
HTTP MethodPOST
Response DataReturns success of operation and the id of the new form template

Config elements

ItemMeaning
question_orderQuestion order index starts on 0

Request body example

JSON
{
"name": string,
"selected": boolean,
"questions": {
"before": [
{
"id": string,
"selected": boolean,
"question": string,
"expanded": boolean,
"anonymize": boolean,
"anonymize_in_days": int,
"visible_on": {
"ticket_kiosks": boolean,
"virtual_ticket": boolean,
"appointments": boolean,
"concierge": boolean,
"extender": boolean,
"qm_pad": boolean,
"card_reader": boolean,
"eticket": boolean
},
"staff_permissions": {
"visible": boolean,
"editable": boolean
},
"depends_on": {
"has_dependency": boolean,
"question": string,
"answer": string
},
"config": string,
"qat_id": string,
"required": boolean,
"question_order": int
},
{...}
],
"during": [],
"end": []
}
}

Responde Example

JSON
{
"success": boolean,
"id": string
}

Update Form Template

ItemValue
NameUpdates existing form template
URLBASE_URI/forms/form_id
HTTP MethodUPDATE
Response DataReturns success of operation and the id of the form template

Request options

ItemValue
form_idNeeds to be a UUID string.

Config elements

ItemMeaning
question_orderQuestion order index starts on 0

Request body example

JSON
{
"name": string,
"selected": boolean,
"questions": {
"before": [
{
"id": string,
"selected": boolean,
"question": string,
"expanded": boolean,
"anonymize": boolean,
"anonymize_in_days": int,
"visible_on": {
"ticket_kiosks": boolean,
"virtual_ticket": boolean,
"appointments": boolean,
"concierge": boolean,
"extender": boolean,
"qm_pad": boolean,
"card_reader": boolean,
"eticket": boolean
},
"staff_permissions": {
"visible": boolean,
"editable": boolean
},
"depends_on": {
"has_dependency": boolean,
"question": string,
"answer": string
},
"config": string,
"qat_id": string,
"required": boolean,
"question_order": int
},
{...}
],
"during": [],
"end": []
}
}

Responde Example

JSON
{
"success": boolean,
"id": string
}

Delete Form Template

ItemValue
NameDelete Form Template
URLBASE_URI/forms/form_id
HTTP MethodDELETE
Response DataReturns success of operation

Request options

ItemValue
form_idNeeds to be a UUID string.

Responde Example

JSON
{
"success": boolean
}

Delete Question Inside a Form Template

ItemValue
NameDelete Question Inside a Form Template
URLBASE_URI/forms/form_id/questions/question_id
HTTP MethodDELETE
Response DataReturns success of operation

Request options

ItemValue
form_idNeeds to be a UUID string.
question_idNeeds to be a UUID string.

Responde Example

JSON
{
"success": boolean
}

Question Answer Types

List Existing Question Answer Types (Questions)

ItemValue
NameList Existing Question Answer Types (Questions)
URLBASE_URI/qats
HTTP MethodGET
Response DataFetches the list of existing question answer types

Config elements

ItemMeaning
toUsed only for Questions of Type Rating
maskUsed only for Questions of Type Text (Format type: 2 - Numeric; 3 - Alpha; 4 - Alphanumeric; 5 - Custom)
lengthUsed only for Questions of Type Text to set Max. length of question answer
regexUsed only for Questions of Type Text with custom format (mask 5)
exampleValid example using the regex above. Used only for Questions of Type Text with custom format (mask 5)

Responde Example

JSON
{
"success": boolean,
"question_answer_types": [
{
"id": string,
"name": string,
"type": int,
"config": {
"mask": int,
"length": string
},
"permanent": boolean,
"expanded": boolean,
"selected": boolean
},
{...}
]
}

Create Question Answer Type

ItemValue
NameCreate Question Answer Type
URLBASE_URI/qats
HTTP MethodPOST
Response DataReturns success of operation and the new question answer type

Config elements

ItemMeaning
toUsed only for Questions of Type Rating
maskUsed only for Questions of Type Text (Format type: 2 - Numeric; 3 - Alpha; 4 - Alphanumeric; 5 - Custom)
lengthUsed only for Questions of Type Text to set Max. length of question answer
regexUsed only for Questions of Type Text with custom format (mask 5)
exampleValid example using the regex above. Used only for Questions of Type Text with custom format (mask 5)

Type elements

ItemMeaning
1Multiple Choice Answer
2Single Choice Answer
3Rating Answer
4Text Answer

Request body example

JSON
[
{
"config": "{
"mask": int,
"length": string
}",
"expanded": booelan,
"id": string,
"name": string,
"permanent": booelan,
"selected": booelan,
"type": int,
"temp": booelan,
"edited": booelan
}
]

Responde Example

JSON
{
"success": boolean,
"qats": [
{
"new": {
"id": string,
"name": string,
"type": int,
"config": string,
"permanent": boolean,
"questions": string,
"question_answers": string,
},
"old": { ... }
}
]
}

Update Question Answer Type

ItemValue
NameUpdate Question Answer Type
URLBASE_URI/qats/qat_id
HTTP MethodUPDATE
Response DataReturns success of operation and the new and old question answer type

Request options

ItemValue
qat_idNeeds to be a UUID string.

Config elements

ItemMeaning
toUsed only for Questions of Type Rating
maskUsed only for Questions of Type Text (Format type: 2 - Numeric; 3 - Alpha; 4 - Alphanumeric; 5 - Custom)
lengthUsed only for Questions of Type Text to set Max. length of question answer
regexUsed only for Questions of Type Text with custom format (mask 5)
exampleValid example using the regex above. Used only for Questions of Type Text with custom format (mask 5)

Type elements

ItemMeaning
1Multiple Choice Answer
2Single Choice Answer
3Rating Answer
4Text Answer

Request body example

JSON
[
{
"config": "{
"mask": int,
"length": string
}",
"expanded": booelan,
"name": string,
"permanent": booelan,
"selected": booelan,
"type": int,
"temp": booelan,
"edited": booelan
}
]

Responde Example

JSON
{
"success": boolean,
"qats": [
{
"new": {
"id": string,
"name": string,
"type": int,
"config": string,
"permanent": boolean,
"questions": string,
"question_answers": string,
},
"old": { ... }
}
]
}

Delete Question Answer Type

ItemValue
NameDelete Question Answer Type
URLBASE_URI/qats/qat_id
HTTP MethodDELETE
Response DataReturns success of operation

Request options

ItemValue
qat_idNeeds to be a UUID string.

Responde Example

JSON
{
"success": boolean
}

Answer to Forms

List Answers from a Ticket

ItemValue
NameList Answers from a Ticket
URLBASE_URI/forms/form_id/answers/ticket_id
HTTP MethodGET
Response DataFetches the list of existing questions answers from a ticket

Request options

ItemValue
form_idNeeds to be a UUID string.
ticket_idNeeds to be a UUID string.

Responde Example

JSON
{
"success": boolean,
"answers": [
{
"answer_response_1": string,
"answer_response_2": string,
...
}
]
}

Add/Update Answer to a Ticket

ItemValue
NameAdd/Update Answer to a Ticke
URLBASE_URI/forms/form_id/answers
HTTP MethodPOST
Response DataFetches the list of existing question answer types

Request options

ItemValue
form_idNeeds to be a UUID string.

Device Type elements

ItemMeaning
1Ticket Dispenser
6Extender
13Tablet Kiosk
14Concierge
15Virtual Concierge
17Backoffice (Appointments)
18E-ticket
98QM-PAD

Attendance Time elements

ItemMeaning
0Before calling the ticket
1While answering a ticket
2After answering a ticket
JSON
{
"answers": [
{
"qat_id": string,
"question": string,
"question_answer": string,
"question_text": string,
"answer_text": string
},
{...}
],
"device_type": int,
"ticket_id": string,
"has_survey": boolean,
"attendance_time": int
}

Responde Example

JSON
{
"success": boolean,
}

Utility to Forms

Get Checkin Question

ItemValue
NameGet Checkin Question
URLBASE_URI/forms/utility/getCheckinQuestion?lang=lang
HTTP MethodGET
Response DataReturns the question used to check-in appointments

Request options

ItemValue
langNeeds to be a string.
Attention

The mask-repeat attribute is the same as the config length. Which establish the maximum size of the answer, 0 mean unlimited.

Mask Type elements

ItemMeaning
2Numeric
3Alpha
4Alphanumeric
5Custom

Type elements

ItemMeaning
1Multiple Choice Answer
2Single Choice Answer
3Rating Answer
4Text Answer

Responde Example

JSON
{
"success": boolean,
"questions": [
{
"mask": int,
"mask-repeat": int,
"question": string,
"type": int,
"name": string,
"answer": string,
"qat_id": string
}
]
}

Get Communication Question

ItemValue
NameGet Communication Question
URLBASE_URI/forms/utility/getCommunicationQuestion
HTTP MethodGET
Response DataReturns the communication questions used to alert customers for appointments
Attention

The mask-repeat attribute is the same as the config length. Which establish the maximum size of the answer, 0 mean unlimited.

Mask Type elements

ItemMeaning
2Numeric
3Alpha
4Alphanumeric
5Custom

Type elements

ItemMeaning
1Multiple Choice Answer
2Single Choice Answer
3Rating Answer
4Text Answer

Responde Example

JSON
{
"success": boolean,
"questions": [
{
"mail": {
"qat_id": string,
"mask": int,
"mask-repeat": int,
"answer": string,
"type": int,
"question": string,
"name": string
},
"phone": {
"qat_id": string,
"mask": int,
"mask-repeat": int,
"answer": string,
"type": int,
"question": string,
"name": string
}
}
]
}

Get Customer Identification Question

ItemValue
NameGet Customer Identification Question
URLBASE_URI/forms/utility/getCustomerIdentificationQuestion?lang=lang
HTTP MethodGET
Response DataReturns the question used for the customer to login (usually email or phone)

Request options

ItemValue
langNeeds to be a string.
Attention

The mask-repeat attribute is the same as the config length. Which establish the maximum size of the answer, 0 mean unlimited.

Mask Type elements

ItemMeaning
2Numeric
3Alpha
4Alphanumeric
5Custom

Type elements

ItemMeaning
1Multiple Choice Answer
2Single Choice Answer
3Rating Answer
4Text Answer

Responde Example

JSON
{
"success": boolean,
"questions": [
{
"qat_id": string,
"mask": int,
"mask-repeat": int,
"answer": string,
"type": int,
"question": string,
"name": string,
"required": boolean
}
]
}