Appointments API
Content
This guide provides information on how to interact with the Appointments REST API of Bloom Enterprise.
How to use it?
| Item | Value |
|---|---|
| BASE_URI | http://SERVER_IP/appwidget |
| RESPONSE_FORMAT | JSON |
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.
Location
List locations
| Item | Value |
|---|---|
| Name | List |
| URL | BASE_URI/location/list |
| HTTP Method | POST |
| Response Data | Fetches a list of locations. Can be filtered by location and server service group id. Can be translated by sending the correct language code. |
Request options
| Item | Value |
|---|---|
| server_service_id | Can be a string or null. |
| location_group_id | Can be a string or null. |
| lang | Can be a string or null. |
Query parameters
| Item | Value |
|---|---|
| filter[region][] | String |
| filter[city][] | String |
Request body example
{
"server_service_group_id ": string,
"location_group_id ": string,
"lang ": string (Ex: pt_PT),
}
Query parameters example
| Item | Value |
|---|---|
| URL | BASE_URI/location/list?filter[region][]=STRING&filter[city][]=STRING |
Responde Example
{
success: boolean,
locations: [
{
id: string,
name: string,
group: {
id: string/null,
name: string/null,
}
},
{...}
]
}
List with groups
| Item | Value |
|---|---|
| Name | List with groups |
| URL | BASE_URI/location/listwithgroups |
| HTTP Method | POST |
| Response Data | Fetches a list of locations and groups. Can be filtered by location and server service group id. Can be translated by sending the correct language code. |
Request options
| Item | Value |
|---|---|
| server_service_id | Can be a string or null. |
| location_group_id | Can be a string or null. |
| lang | Can be a string or null. |
Request body example
{
"server_service_group_id ": string,
"location_group_id ": string,
"lang ": string (Ex: pt_PT),
}
Query parameters example
| Item | Value |
|---|---|
| URL | BASE_URI/location/listwithgroups?filter[region][]=STRING&filter[city][]=STRING |
Responde Example
{
success: boolean,
locations: [
{
id: string,
name: string,
coordinates: string,
group: {
id: string/null,
name: string/null,
}
},
{...}
],
location_groups: [
{
id: string,
label: string,
value: boolean
},
{...}
]
}
List cities
| Item | Value |
|---|---|
| Name | List cities |
| URL | BASE_URI/location/listcities |
| HTTP Method | GET |
| Response Data | Get a list of cities. |
Response example
{
success: boolean,
cities: [
string,
string,
...
]
}
List regions
| Item | Value |
|---|---|
| Name | List regions |
| URL | BASE_URI/location/listregions |
| HTTP Method | GET |
| Response Data | Get a list of regions. |
Response example
{
success: boolean,
regions: [
string,
string,
...
]
}
Location groups
List location groups
| Item | Value |
|---|---|
| Name | List location groups |
| URL | BASE_URI/locationgroup/list |
| HTTP Method | POST |
| Response Data | Lists the location groups. If filter is sent, lists the location groups that have the server service specified. |
Request options
| Item | Value |
|---|---|
| server_service_id | Can be a string or null. |
Request body example
{
"server_service_id": string,
}
Responde Example
{
success: boolean,
location_groups: [
{
id: string,
name: string,
description: string,
coordinates: string,
},
{...}
]
}
Server Services
List all or a specific server service
| Item | Value |
|---|---|
| Name | List all or a specific server service |
| URL | BASE_URI/serverservice/list |
| HTTP Method | POST |
| Response Data | Get a list of server services and their info. Can be filtered by location and server service group id. Can be translated by sending the correct language code. |
Request options
| Item | Value |
|---|---|
| server_service_group_id | Can be a string or null. |
| location_id | Can be a string or null. |
| lang | Can be a string or null. |
Request body example
{
"server_service_group_id ": string,
"location_id ": string,
"lang ": string (Ex: pt_PT),
}
Response example
{
success: boolean,
services: [
{
id: string,
name: string,
server_service_group: {
id: string/null,
name: string/null,
}
},
{...}
]
}
List all or a specific server service and server services groups
| Item | Value |
|---|---|
| Name | List all or a specific server service and server services groups |
| URL | BASE_URI/serverservice/listwithgroups |
| HTTP Method | POST |
| Response Data | Get a list of server services and server service groups with their info. |
Request options
| Item | Value |
|---|---|
| server_service_group_id | Can be a string or null. |
| location_id | Can be a string or null. |
| lang | Can be a string or null. |
Request body example
{
"server_service_group_id ": string,
"location_id ": string,
"lang ": string (Ex: pt_PT),
}
Response example
{
success: boolean,
services: [
{
id: string,
name: string,
server_service_group: {
id: string/null,
name: string/null,
}
},
{...}
],
service_groups: [
{
id: string,
label: string,
value: boolean
},
{...}
]
}
Appointments
Create an appointment
| Item | Value |
|---|---|
| Name | Create an appointment |
| URL | BASE_URI/appointment |
| HTTP Method | POST |
| Response Data | A list of successful appointments and a list of impossible appointments. |
Request options
| Item | Value |
|---|---|
| server_service_id | String |
| location_id | String |
| date | String (dd/mm/yyyy). |
| hour | String (hh:mm). |
Request body example
{
"server_service_id ": string,
"location_id": string,
"date": string dd/mm/yyyy,
"hour": string hh:mm,
}
Response example
{
success: boolean,
successfulAppointments: [
{
id:string,
date:string,
hour:string,
checkin:string
},
impossibleAppointments: [
{
id:string,
date:string,
hour:string,
checkin:string
},
],
is_confirmed: 0/1 (int)
}
Get appointments
| Item | Value |
|---|---|
| Name | Get appointments |
| URL | http://SERVER_IP/restapi/appointments/getAppointments |
| HTTP Method | GET |
| Response Data | A list of successful appointments and a list of impossible appointments. |
Request options
| Item | Value |
|---|---|
| resources | Array [User ID, Service ID or Location ID] |
| date | Array [Start Date String (yyyy-mm-dd hh:mm:ss), End Date String (yyyy-mm-dd hh:mm:ss)] |
| status | Array [Integers] |
Status
| Item | Meaning |
|---|---|
| 0 | Appointment Pending |
| 1 | Appointment Confirmed |
| 2 | Appointment Finished |
| 3 | Appointment Deleted |
| 5 | Appointment Invalid |
| 6 | Appointment Expired |
| 8 | Appointment Checked in |
Query parameters example
| Item | Value |
|---|---|
| URL | http://SERVER_IP/restapi/appointments/getAppointments?filter[resources][]=STRING&filter[date][]=STRING&filter[status][]=STRING |
Response example
{
"success": boolean,
"data": {
"appointments": [
{
"id": string,
"starting_time": string dd/mm/yyyy hh:mm,
"ending_time": string dd/mm/yyyy hh:mm,
"status": integer,
"display_name": string,
"customer": string/null,
"service": {
"id": string,
"name": string,
"address": string
},
"code": string,
"answers": [
{
"id": string,
"question_text": string,
"question_answer": string,
"question": string,
"answer_text": string,
"device_type": integer,
"qat_id": string
}
],
"appointment": {
"answers": {
"text": string
}
}
}
],
"global_configurations": [
{
"id": string,
"value": string
},
{
"id": string,
"value": string
}
]
}
}
Update appointment
| Item | Value |
|---|---|
| Name | Update appointments |
| URL | http://SERVER_IP/restapi/appointments/updateAppointments |
| HTTP Method | POST |
| Response Data | success or error message |
Request options (Array of objects)
| Item | Value |
|---|---|
| id | String |
| checkedin_at | Date String (yyyy-mm-dd hh:mm:ss) |
| status | Integer |
| answers | Array [Question Answers] |
Status
| Item | Meaning |
|---|---|
| 0 | Appointment Pending |
| 1 | Appointment Confirmed |
| 2 | Appointment Finished |
| 3 | Appointment Deleted |
| 5 | Appointment Invalid |
| 6 | Appointment Expired |
| 8 | Appointment Checked in |
Request example
[
{
"id": string,
"checkedin_at": string dd/mm/yyyy hh:mm,
"status": integer,
"answers": [
{
"id": string,
"answer_text": string,
"qat_id": string,
"question": string,
"question_answer": string,
"question_text": string
}
]
}
]
Booking
Get free appointment slots
| Item | Value |
|---|---|
| Name | Get free appointment slots |
| URL | BASE_URI/booking/freeSlots |
| HTTP METHOD | POST |
| RESPONSE DATA | A list of free appointment slots by day. |
Request options
| Item | Value |
|---|---|
| server_service_id | String |
| location_id | String |
| year | Integer |
| month | Integer |
| day | Integer |
| from | String (hh:mm) |
| to | String (hh:mm) |
Request example
{
"server_service_id ": string,
"location_id": string,
"year": string YYYY,
"month": string MM,
"day": string DD,
"from": string hh:mm,,
}
Response example
{
“success”: boolean,
“slots”:[
{
“day”: “dd/mm/yyyy”
“weekday”: 1-7
“hours”:[
“hh:mm”,
(…)
]
}
(…)
]
}
Get free appointment slots by day
| Item | Value |
|---|---|
| Name | Get free appointment slots by day |
| URL | BASE_URI/booking/freeSlotsDay |
| HTTP METHOD | POST |
| RESPONSE DATA | A list of free appointment slots by day. |
Request options
| Item | Value |
|---|---|
| server_service_id | String |
| location_id | String |
| year | Integer |
| month | Integer |
| day | Integer |
| from | String (hh:mm) |
| to | String (hh:mm) |
Request example
{
"server_service_id ": string,
"location_id": string,
"year": string YYYY,
"month": string MM,
"day": string DD,
"from": string hh:mm,,
}
Response example
{
“success”: boolean,
“hours”:[
“hh:mm”,
(…)
]
}
Get if is free to book
| Item | Value |
|---|---|
| Name | Get if is free to book |
| URL | BASE_URI/booking/freeToBook |
| HTTP METHOD | GET |
| RESPONSE DATA | A list of free appointment slots by day. |
Get taken appointment slots
| Item | Value |
|---|---|
| Name | Get taken appointment slots |
| URL | BASE_URI/booking/takenSlots |
| HTTP METHOD | POST |
| RESPONSE DATA | A list of taken appointment slots. |
Request options
| Item | Value |
|---|---|
| server_service_id | String |
| location_id | String |
| year | Integer |
| month | Integer |
| day | Integer |
| from | String (hh:mm) |
| to | String (hh:mm) |
Request body example
{
"server_service_id ": string,
"location_id": string,
"year": string YYYY,
"month": string MM,
"day": string DD,
"from": string hh:mm,,
}
Response example
{
“success”: boolean,
“blocks”:[
{
“dd/mm/yyyy”: {
“hours”: [
“hh:mm”,
“hh:mm”,
(...)
],
“details”: {
“day”: “d”,
“month”: “d”,
“weekday”: 1-7,
}
}
}
(…)
]
}
Widget
Get widget layout
| Item | Value |
|---|---|
| Name | Get widget layout |
| URL | BASE_URI/appointments/widget |
| HTTP METHOD | GET |
| RESPONSE DATA | Get a html with a widget layout |
Response example
<html>
…
</html>
Check-in
Check-in a ticket from an appointment
Need a Bearer token see the documentation for:
API Queue Management
| Item | Value |
|---|---|
| URL | http://SERVER_IP/restapi/v2/queuemanagement/checkin |
| HTTP METHOD | JSON |
| RESPONSE DATA | Success or error message |
Request options
| Item | Value |
|---|---|
| code | Integer [REQUIRED] |
| lang | String (guid) |
| device_id | String (guid) |
| eticket_customer | String (guid) |
Request example
{
"success": boolean,
“ticket”: {
"id": string (guid),
"number": integer,
"date": string (date),
"cancelled": boolean,
"transferred": boolean,
"state": integer,
"note": string,
"lang": string (guid),
"custom_field": string,
"client_name": string,
"flags": integer,
"app_displayname": string,
"app_id": string (guid),
"scheduled_to": string (date),
"ticket_service": {
(...)
},
"dst_service": {
(...)
},
"dst_desk": {
(...)
},
"dst_user": {
(...)
},
"device": {
(...)
},
"location": string (guid),
"dst_location": {
(...)
},
"extra_info": [
{
"answer": string,
"answer_text": string,
"id": string,
"question": string
},
(...)
],
"tickets_to_print": integer,
"number_of_waiting_tickets": integer,
"avg_waiting_time": integer
},
“ticket_strings”: {
"people_waiting": string,
"waiting_time": string,
"date_text": string,
"prioritary_ticket": string,
"extra_text": string,
"footer_text": string
},
}