Forms API
Content
This guide provides information on how to interact with the Forms REST API of Bloom Enterprise.
How to use it?
| Item | Value |
|---|---|
| BASE_URI | http://SERVER_IP/restapi/v2/ |
| RESPONSE_FORMAT | JSON |
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
| Item | Value |
|---|---|
| Name | List Existing Forms Templates |
| URL | BASE_URI/forms |
| HTTP Method | GET |
| Response Data | Fetches 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
| Item | Value |
|---|---|
| Name | Details Form Template |
| URL | BASE_URI/forms/form_id |
| HTTP Method | GET |
| Response Data | Returns the details of a specific form template |
Request options
| Item | Value |
|---|---|
| form_id | Needs 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
| Item | Value |
|---|---|
| Name | Create form template |
| URL | BASE_URI/forms |
| HTTP Method | POST |
| Response Data | Returns success of operation and the id of the new form template |
Config elements
| Item | Meaning |
|---|---|
| question_order | Question 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
| Item | Value |
|---|---|
| Name | Updates existing form template |
| URL | BASE_URI/forms/form_id |
| HTTP Method | UPDATE |
| Response Data | Returns success of operation and the id of the form template |
Request options
| Item | Value |
|---|---|
| form_id | Needs to be a UUID string. |
Config elements
| Item | Meaning |
|---|---|
| question_order | Question 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
| Item | Value |
|---|---|
| Name | Delete Form Template |
| URL | BASE_URI/forms/form_id |
| HTTP Method | DELETE |
| Response Data | Returns success of operation |
Request options
| Item | Value |
|---|---|
| form_id | Needs to be a UUID string. |
Responde Example
JSON
{
"success": boolean
}
Delete Question Inside a Form Template
| Item | Value |
|---|---|
| Name | Delete Question Inside a Form Template |
| URL | BASE_URI/forms/form_id/questions/question_id |
| HTTP Method | DELETE |
| Response Data | Returns success of operation |
Request options
| Item | Value |
|---|---|
| form_id | Needs to be a UUID string. |
| question_id | Needs to be a UUID string. |
Responde Example
JSON
{
"success": boolean
}
Question Answer Types
List Existing Question Answer Types (Questions)
| Item | Value |
|---|---|
| Name | List Existing Question Answer Types (Questions) |
| URL | BASE_URI/qats |
| HTTP Method | GET |
| Response Data | Fetches the list of existing question answer types |
Config elements
| Item | Meaning |
|---|---|
| to | Used only for Questions of Type Rating |
| mask | Used only for Questions of Type Text (Format type: 2 - Numeric; 3 - Alpha; 4 - Alphanumeric; 5 - Custom) |
| length | Used only for Questions of Type Text to set Max. length of question answer |
| regex | Used only for Questions of Type Text with custom format (mask 5) |
| example | Valid 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
},
{...}
]
}