Skip to main content

Queue Management API

Content

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

Through HTTP requests, this API allows generating and managing tickets, and requesting tickets lists per status and the overall queuing status.

How to use

HTTP fundamentals

It is required a universal syntax to identify each service in the RESTful API, which is redirected by its URI (Uniform Resource Identifier). All API requests are made through HTTP requests to the URI, referring in the URI the service it must consume. Depending on the service’s action, the request’s header must have the operation which represents the aimed resource’s manipulation.

OperationDescription
DELETEResponsible for a specific resource.
GETResponsible for reading a specific resource.
POSTResponsible for transferring the status of a specific resource.
PUTResponsible for creating or updating a resource set by the URI.

The data output must be specified in the URI, although by omission, the operation’s result is given in JSON format. In case the expected output to be XML format, it must be specified in the address.

The basic URI is:

http://SERVER_IP:HTTP_PORT/restapi/v2/queuemanagement/requested_operation?format=xml

Where:

ItemValue
SERVER_IPBloom Enterprise server’s IP address.
HTTP_PORTHTTP communication port (optional).
requested_operationRequested system operation.
format=xmlTo get a response in XML format (optional).
tip

If HTTP_PORT empty, it will assume the port 80 by default.

All answers are followed by the request’s success status. For instance, the structure of the result of calling a ticket is:

{
"success" : true,
"answer" : {
(...)
}
}

In case of failure, all messages will be followed by an error code:

{
"success": false,
"errno": 2
}

Where:

  1. URI not specified.
  2. Invalid HTTP method.
  3. Invalid operation.
  4. Invalid answer format.
  5. Invalid parameters.
  6. No values found.
  7. The operation cannot be concluded.
  8. No tickets available.
  9. Unknown error.

All error codes above 100, are related to specific operations, and their descriptions will be in the trigger operations.

danger

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.

API Authentication

It is possible to enable/disable bloom API authentication, this way we assure every queue management communication with API is done only by authenticated users and the amount of results shown are only the ones authorised.

To enable/disable API authentication all we need to do is navigate to Settings and enable the option “Enable API authentication” as shown below.

Alt image QM API 1

Once the option is enabled we use the following endpoint to manage the authorizations.

Login user

This request allows users to login in order to use the API. The response includes the generated authorization key (JWT) which should be used in all the request headers as “Authorization”.

The Authorization header is a bearer token and it should be used as follow:

KeyValue
AuthorizationBearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4NzkzNjBlOWY(...)
note

The generated authorization key, for security reasons, is valid only for seven days. After this period a new key should be requested.

ItemValue
Requested operationlogin
HTTP methodPOST
Parametersuser_id (string)ID of the user.

Response structure

{
"success" : Boolean,
"user_id" : String,
"username" : String,
"authtoken" : String,
}

Tickets Management

Call a specific ticket

This request allows calling a specific ticket. The response includes all information about that ticket.

ItemValue
Requested operationcallticket
HTTP methodPOST
Roles Requiredacl_qmpad_access qm_qmpad_select_services qm_qmpad_issues_services, Access QM-PAD The user can select services The user can select tickets from the waiting list
Parametersdesk_id (string) ID of the counter.
user_id (string) ID of the user.
ticket_id (string) ID of the ticket.

Response structure

{
"success" : Boolean,
"answer" : {
"id" : String,
"call_date" : String (format: aaaa-mm-dd hh:mm:ss),
"end_date" : String (format: aaaa-mm-dd hh:mm:ss),
"state" : String,
"ticket" : {
"id" : String,
"number" : String,
"date" : String (format: aaaa-mm-dd hh:mm:ss),
"cancelled" : String,
"transferred" : String,
"state" : String,
"note" : String,
"lang" : String,
"custom_field" : String,
"client_name" : String,
"flags" : String,
"app_displayname" : String,
"app_id" : String,
"scheduled_to" : String (format: aaaa-mm-dd hh:mm:ss),
"ticket_service" : {
"id" : String,
"name" : String,
"tag" : String,
},
"dst_service" : {
"id" : String,
"name" : String,
"tag" : String,
},
"dst_desk" : {
"id" : String,
"name" : String,
"tag" : String,
},
"dst_user" : {
"id" : String,
"display_name" : String,
"username" : String,
},
"device" : {
"id" : String,
"type" : String,
"name" : String,
}
}
}
}

Call the next ticket

This request allows calling the next ticket. The response includes all information about that ticket.

ItemValue
Requested operationcallnextticket
HTTP methodPOST
Roles Requiredacl_qmpad_access qm_qmpad_issues_services, Access QM-PAD The user can select services The user can select tickets from the waiting list
Parametersdesk_id (string) ID of the counter.
user_id (string) ID of the user.
services (array JSON) ID's of the services.

Response structure

{
"success": Boolean,
"answer": {
"id": String,
"call_date": String, // format: "aaaa-mm-dd hh:mm:ss"
"end_date": String, // format: "aaaa-mm-dd hh:mm:ss"
"state": String,
"ticket": {
"id": String,
"number": String,
"date": String, // format: "aaaa-mm-dd hh:mm:ss"
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: "aaaa-mm-dd hh:mm:ss"

"ticket_service": {
"id": String,
"name": String,
"tag": String
},

"dst_service": {
"id": String,
"name": String,
"tag": String
},

"dst_desk": {
"id": String,
"name": String,
"tag": String
},

"dst_user": {
"id": String,
"display_name": String,
"username": String
},

"device": {
"id": String,
"type": String,
"name": String
}
}
}
}

Recall the ticket

This request allows recalling the ticket.

ItemValue
Requested operationrecall
HTTP methodPOST
Roles Requiredacl_qmpad_access, Access QM-PAD
Parametersanswer_id (string) ID of the answer .

Response structure

{
"success" : Boolean
}
tip

answer_id - ID field from the answer object received when calling the createTicket method.

End ticket

This request allows ending the service of the ticket.

ItemValue
Requested operationendcall
HTTP methodPOST
Roles Requiredacl_qmpad_access, Access QM-PAD
Parametersanswer_id (string) ID of the answer .

Response structure

{
"success" : Boolean
}

Pause ticket

This request allows pausing the service of the ticket.

ItemValue
Requested operationpausecall
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD, qm_qmpad_user_pause_ticket The user can pause tickets
Parametersanswer_id (string) ID of the answer .

Response structure

{
"success" : Boolean
}

Call a paused ticket

This request allows calling a paused ticket. The response includes all information about that ticket.

ItemValue
Requested operationcallpausedticket
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD
Parametersdesk_id (string) ID of the counter .
user_id (string) ID of the user .
ticket_id (string) ID of the ticket .

Response structure

{
"success": Boolean,
"answer": {
"id": String,
"call_date": String, // format: "aaaa-mm-dd hh:mm:ss"
"end_date": String, // format: "aaaa-mm-dd hh:mm:ss"
"state": String,
"ticket": {
"id": String,
"number": String,
"date": String, // format: "aaaa-mm-dd hh:mm:ss"
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: "aaaa-mm-dd hh:mm:ss"

"ticket_service": {
"id": String,
"name": String,
"tag": String
},

"dst_service": {
"id": String,
"name": String,
"tag": String
},

"dst_desk": {
"id": String,
"name": String,
"tag": String
},

"dst_user": {
"id": String,
"display_name": String,
"username": String
},

"device": {
"id": String,
"type": String,
"name": String
}
}
}
}

Cancel the ticket

This request allows cancelling the ticket.

ItemValue
Requested operationcancelcall
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD
Parametersanswer_id (string) ID of the answer .

Response structure

{
"success" : Boolean
}

Call a cancelled ticket

This request allows calling a cancelled ticket. The response includes all information about that ticket.

ItemValue
Requested operationcallcancelledticket
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD
Parametersdesk_id (string) ID of the counter .
user_id (string) ID of the user .
ticket_id (string) ID of the ticket .

Response structure

{
"success": Boolean,
"answer": {
"id": String,
"call_date": String, // format: aaaa-mm-dd hh:mm:ss
"end_date": String, // format: aaaa-mm-dd hh:mm:ss
"state": String,
"ticket": {
"id": String,
"number": String,
"date": String, // format: aaaa-mm-dd hh:mm:ss
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: aaaa-mm-dd hh:mm:ss
"ticket_service": {
"id": String,
"name": String,
"tag": String
},
"dst_service": {
"id": String,
"name": String,
"tag": String
},
"dst_desk": {
"id": String,
"name": String,
"tag": String
},
"dst_user": {
"id": String,
"display_name": String,
"username": String
},
"device": {
"id": String,
"type": String,
"name": String
}
}
}
}

Transfer the ticket

This request allows transferring the ticket to another service, counter, or user.

ItemValue
Requested operationtransfercall
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD, qm_qmpad_transfer_tickets The user can transfer tickets
Parametersanswer_id (string) ID of the answer .
dst_type (string) Type of the transfer destination (“service”, “desk”, “user”).
dst_id (string) ID of the transfer destination
note (string) Text note associated to the ticket (optional).
priority (string) Sets the ticket as a priority ticket.
custom_field (string) Custom text field to add to the transferred ticket (optional).
desk_id (string) ID of the counter

Response structure

{
"success" : Boolean
}

Tickets

Generate a ticket

This request allows generating a ticket for a specific service. The response includes all ticket information, and the field ticket_strings which responds with the requested text content for the printed ticket, if a device_id has been specified. These texts are translated according to the language specified in the field lang (by default, if there is no specified language, it will assume the system’s language).

ItemValue
Requested operationcreateticket
HTTP methodPOST
Roles Requiredacl_qmpad_access Access QM-PAD, qm_qmpad_select_services The user can select services, qm_qmpad_issues_services The user can select tickets from the waiting list
Parametersdesk_id (string) ID of the counter (optional).
user_id (string) ID of the user (optional).
service_id (string) ID of the service.
lang (string) ID of the language for the generated ticket (optional).
custom_field (string) Custom text field associated to the transferred ticket (optional).
client_name (string) Visitor’s name (optional).
device_id (string) ID of the device in which the ticket was generated (optional).
priority (bool) Identifies if the ticket is a priority ticket (optional).
appointment (string) Identifies if the ticket is an appointment ticket (optional).
scheduled_to (string) Appointment date in format: aaaa-mm-dd hh:mm:ss (optional).
from_virtualticket (string) Identifies if the ticket is a virtual ticket (optional).

Response structure

{
"success": Boolean,
"ticket": {
"id": String,
"number": String,
"date": String, // format: aaaa-mm-dd hh:mm:ss
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: aaaa-mm-dd hh:mm:ss
"ticket_service": {
"id": String,
"name": String,
"tag": String
},
"dst_service": {
"id": String,
"name": String,
"tag": String
},
"dst_desk": {
"id": String,
"name": String,
"tag": String
},
"dst_user": {
"id": String,
"display_name": String,
"username": String
},
"device": {
"id": String,
"type": String,
"name": String
},
"number_of_waiting_tickets": String,
"avg_waiting_time": String // format: hh:mm:ss
},
"ticket_strings": {
"people_waiting": String,
"waiting_time": String, // in seconds
"date_text": String,
"prioritary_ticket": String,
"extra_text": String,
"footer_text": String
}
}

List of paused tickets

This request allows listing the paused ticket of a specific service.

ItemValue
Requested operationpausedticketslist
HTTP methodPOST
Parametersdesk_id (string) ID of the counter .

Response structure

{
"success": Boolean,
"tickets": [
{
"id": String,
"number": String,
"date": String, // formato: aaaa-mm-dd hh:mm:ss
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // formato: aaaa-mm-dd hh:mm:ss
"ticket_service": {
"id": String,
"name": String,
"tag": String
},
"dst_service": {
"id": String,
"name": String,
"tag": String
},
"dst_desk": {
"id": String,
"name": String,
"tag": String
},
"dst_user": {
"id": String,
"display_name": String,
"username": String
},
"device": {
"id": String,
"type": String,
"name": String
}
},
...
]
}

List of waiting tickets

This request allows listing the waiting tickets of a specific service.

ItemValue
Requested operationwaitingticketslist
HTTP methodPOST
Parametersservice_id (string) ID of the service .

Response structure

{
"success": Boolean,
"tickets": [
{
"id": String,
"number": String,
"date": String, // format: yyyy-mm-dd hh:mm:ss
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: yyyy-mm-dd hh:mm:ss

"ticket_service": {
"id": String,
"name": String,
"tag": String
},

"dst_service": {
"id": String,
"name": String,
"tag": String
},

"dst_desk": {
"id": String,
"name": String,
"tag": String
},

"dst_user": {
"id": String,
"display_name": String,
"username": String
},

"device": {
"id": String,
"type": String,
"name": String
}
},
...
]
}

List of cancelled tickets

This request allows listing the cancelled tickets of a specific service. This list is filtered by the ticket tolerance configured in the system’s backoffice.

ItemValue
Requested operationcancellededticketslist
HTTP methodPOST
Parametersdesk_id (string) ID of the counter .

Response Structure

{
"success": Boolean,
"tickets": [
{
"id": String,
"number": String,
"date": String, // format: yyyy-mm-dd hh:mm:ss
"cancelled": String,
"transferred": String,
"state": String,
"note": String,
"lang": String,
"custom_field": String,
"client_name": String,
"flags": String,
"app_displayname": String,
"app_id": String,
"scheduled_to": String, // format: yyyy-mm-dd hh:mm:ss

"ticket_service": {
"id": String,
"name": String,
"tag": String
},

"dst_service": {
"id": String,
"name": String,
"tag": String
},

"dst_desk": {
"id": String,
"name": String,
"tag": String
},

"dst_user": {
"id": String,
"display_name": String,
"username": String
},

"device": {
"id": String,
"type": String,
"name": String
}
}
...
]
}

Number of waiting tickets and average waiting time

This request allows getting information on the number of waiting tickets and the average waiting time by service.

ItemValue
Requested operationwaitingticketscount
HTTP methodGET

Response structure

{
"success" : Boolean,
"services" : [
{
"id" : String,
"tag" : String,
"description" : String,
"number_of_waiting_tickets" : String,
"open" : Boolean,
"avg_waiting_time" : String (in seconds),
},
(...)
]
}
tip

To get the list of services from a specific location, insert the location’s URL in the ID.
For example:
/waitingticketscount/location_id