Skip to main content

Virtual Ticket API

Content

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

How to use it?

ItemValue
BASE_URIhttp://virtual-ticket-server.com/vt/api
RESPONSE_FORMAT- XML
- JSON

Users and Authentication

Register

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/register
HTTP methodPOST
Response dataRegister a new user

Request options

ItemValue
oauth_providerCan be Google, Facebook, or null.
oauth_tokenNull if oauth_provider is null.
usernameCustomer’s username.
passwordCustomer’s password.
emailCustomer’s email.
phoneCustomer’s phone number.
pushnotificationCustomer’s push notification key.
first_nameCustomer’s first name.
last_nameCustomer’s last name.

Request example

JSON
{
"oauth_provider": "google",
"oauth_token": "rgfeojn",
"username": "customer1",
"password": "aksjdhf879234",
"email": "qbetter@qbetter.com",
"phone": "91626592",
"first_name": "Joaquim",
"last_name": "Gomes"
}

Response example

JSON
{
"success": true,
"vt_token": "frewjng4"
}

Login / Update customer

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/login
HTTP methodPOST
Response dataLog in to get a vt_token for future communications. If “customer_attribute” is set, it will update it.

Request example

JSON
{
"oauth_provider": "google",
"oauth_token": "rgfeojn",
"username": null,
"password": null,
"customer_attribute": {
"name": "Joaquim"
}
}

Response example

JSON
{
"success": true,
"vt_token": "frewjng4"
}

Customer details

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/details
HTTP methodPOST
Response dataGet customer details

Response example

JSON
{
"status": {
"success": "true"
},
"user": {
"id": "uuid",
"username": "username",
"first_name": "",
"last_name": "",
"display_name": "Name",
"phone": null,
"email": null,
"vt_token": “token”,
"oauth_provider": null,
"oauth_token": null,
"push_notification_key": null,
"address": null,
"created_at": "yyyy-MM-dd hh:mm:ss",
"updated_at": " yyyy-MM-dd hh:mm:ss ",
"app_count": 0,
"reset_token": null,
"reset_token_date": null,
"ticket_warning": 0,
"preferred_language": null
}
}

Customer reset password

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/resetpassword
HTTP methodGET
Response dataTrue or false

Query parameters

ItemValue
emailMandatory parameter, string.

Response example

JSON
{
"success": true/false,
}

Customer new password

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/newpassword
HTTP methodPOST
Response dataTrue or false and Token

Request example

JSON
{
"vt": true/false,
"password": string,
"repeat_password": string,
"token":string
}

Response example

JSON
{
"success": true/false,
“vt_token”: string
}

Locations / Masters

List locations or one specific location

ItemValue
URLBASE_URI/RESPONSE_FORMAT/locations/get
HTTP methodGET
Response dataGet a list of locations and their info, including services and tickets.

Query parameters

ItemValue
regionCan be a string.
cityCan be a string.
coordinatesCan be a string. (ex.: “41.5725702999,-8.4263883”)

Response example

JSON
{
"status": {
"success": "true"
},
"locations": [
{
"id": "81ddf0e9-9e21-4bc1-a400-f40411931fbf",
"name": "Q-Better",
"city": "Braga",
"region": "Braga",
"country": "Portugal",
"coordinates": "41.572408,-8.426258,868",
"address": "Rua Dr. Manuel José de Oliveira Machado, n.º 37",
“isOpen”: true/false
"working_hours": [
{
“open_today_from”: “YYYY-mm-dd HH:mm:ss”,
“open_today_to”: “YYYY-mm-dd HH:mm:ss”
},
{
“open_today_from”: “YYYY-mm-dd HH:mm:ss”,
“open_today_to”: “YYYY-mm-dd HH:mm:ss”
}
],
"services": [
{
"id": "1547c9bd-ba1a-4348-8dee-d61f71bc635c",
"tag": "A",
"description": "Service A",
"waiting_tickets": "0",
"waiting_avg": "hh:mm",
"state": 0
},
{
"id": "54f419e3-e38e-409b-8c61-ddaac01bd6c7",
"tag": "B",
"description": "Service B",
"waiting_tickets": "0",
"waiting_avg": "0",
"state": 0
}
],
},
{
"id": "eef1c6b5-6362-462f-a1eb-b23ad0a4b043",
"name": "Company",
"city": "Some City",
"country": "Some Country",
"region": "Braga",
"coordinates": "",
"address": "Main Road",
"working_hours": "",
"contacts": "",
"options": "",
"created_at": "2016-04-07 14:33:39",
"updated_at": "2016-04-07 14:33:39",
"services": [],
"tickets": []
}
],
"settings": {
"request_ticket_radius": 50,
“request_ticket_min_customers": 9000,
"request_ticket_min_waiting_time": 0,
"allow_multi_ticket": false,
"notification_texts": {
"your_turn": {
"title": "It's your turn!",
"message": "Your ticket %{ticket.tag}%{ticket.number} was just called. Please head to desk %{ticket.desk.tag}."
},
"almost_your_turn": {
"title": "Heads up! It's almost your turn!",
"message": "There are only %{ticket.customers_ahead} customers ahead of you."
}
}
}
}

Services

ItemValue
URLBASE_URI/RESPONSE_FORMAT/server_services/get
HTTP methodGET
Response dataGet a list of server_services and their info.

Query parameters

ItemValue
server_service_idCan be a string or null.
location_idCan be a string or null.

Response example

JSON
{
"success": true,
"server_services": [
{
"id": "0ab57e35-0a55-4b1b-bae8-bb9021936746",
"name": "Service A",
"state": "",
"description": "",
"locations": [
{
"id": "dcbb6b02-c5c3-4330-994d-1183ab785e0c",
"name": "Location Teste",
"address": "",
"phone": "",
"email": "",
"city": "",
"region": "",
"country": "",
"website": "",
"coordinates": "",
"timezone": "Europe/Lisbon",
"isOpen": false,
"working_hours": [
{
"open_today_from": "2019-12-23 00:00:00",
"open_today_to": "2019-12-23 12:00:00"
},
{
"open_today_from": "2019-12-23 13:00:00",
"open_today_to": "2019-12-23 23:59:00"
}
],
"services": [
{
"id": "0bfe6b8e-a216-475c-bc6f-7ffc8168d464",
"server_service_id": "0ab57e35-0a55-4b1b-bae8-bb9021936746",
"location_id": "dcbb6b02-c5c3-4330-994d-1183ab785e0c",
"name": "Service A",
"color": "#f9ae3b",
"ticket_counter": 0,
"hours": "00",
"minutes": "00",
"tag": "A",
"waiting_tickets": 0,
"waiting_avg": "00:00",
"isOpen": true,
"open_today_from": "2019-12-23 00:00:00",
"open_today_to": "2019-12-23 23:59:59"
}
],
"settings": {
"request_ticket_radius": 50,
"request_ticket_min_customers": 9000,
"request_ticket_min_waiting_time": 0,
"allow_multi_ticket": false,
"notification_texts": {
"your_turn": {
"title": "It's your turn!",
"message": "Your ticket %{ticket.tag}%{ticket.number} was just called. Please head to desk %{ticket.desk.tag}."
},
"almost_your_turn": {
"title": "Heads up! It's almost your turn!",
"message": "There are only %{ticket.customers_ahead} customers ahead of you."
}
}
}
}
],
"isOpen": true,
"open_today_from": "2019-12-23 00:00:00",
"open_today_to": "2019-12-23 23:59:59"
}
]
}

Tickets

List all or a specific ticket

ItemValue
URLBASE_URI/RESPONSE_FORMAT/customer/tickets/ticket_id
HTTP methodGET
Response dataGet a list of tickets and their info. If ticket_id is specified, it returns the info only for that ticket.

Response example

JSON
{
"success": true,
"tickets": [
{
"id": "f20fe43a-2341-11ea-8bdf-00ff8df7375b",
"description": "Service A",
"ticket_number": "A 006",
"tag": "A",
"number": 6,
"create_date": "2019-12-20 16:00:40",
"startcall_date": null,
"endcall_date": null,
"waiting_tickets": "0",
"hours": "00",
"minutes": "00",
"state": 0,
"customer": {
"id": "a71e6c15-5c31-4631-947d-157c6b96711d",
"display_name": "André Araújo",
"phone": null,
"email": null
},
"master": {
"id": "dcbb6b02-c5c3-4330-994d-1183ab785e0c",
"name": "Location Teste",
"address": "",
"phone": "",
"email": "",
"website": "",
"coordinates": "",
"timezone": "Europe/Lisbon"
},
"service": {
"id": "0bfe6b8e-a216-475c-bc6f-7ffc8168d464",
"master_id": null,
"tag": "A",
"description": "",
"name": "Service A",
"color": null
}
}
]
}

Create ticket

ItemValue
URLBASE_URI/RESPONSE_FORMAT/ticket/create
HTTP methodPOST
Response dataCreate a new VT ticket

Request example

{
"tickets": [
{
"master_id": "dcbb6b02-c5c3-4330-994d-1183ab785e0c",
"service_id": "0bfe6b8e-a216-475c-bc6f-7ffc8168d464"
}
]
}

Response example

{
"success": true,
"ticket": {
"id": "e3041214-25a6-11ea-b711-00ff8df7375b",
"description": "Service A",
"ticket_number": "A 007",
"tag": "A",
"number": 7,
"create_date": "2019-12-23 17:08:46",
"startcall_date": null,
"endcall_date": null,
"waiting_tickets": "0",
"hours": "00",
"minutes": "00",
"state": 0,
"customer": {
"id": "a71e6c15-5c31-4631-947d-157c6b96711d",
"display_name": "André Araújo",
"phone": null,
"email": null
},
"master": {
"id": "dcbb6b02-c5c3-4330-994d-1183ab785e0c",
"name": "Location Teste",
"address": "",
"phone": "",
"email": "",
"website": "",
"coordinates": "",
"timezone": "Europe/Lisbon"
},
"service": {
"id": "0bfe6b8e-a216-475c-bc6f-7ffc8168d464",
"master_id": null,
"tag": "A",
"description": "",
"name": "Service A",
"color": null
}
}
}

Cancel ticket

ItemValue
URLBASE_URI/RESPONSE_FORMAT/ticket/cancel
HTTP methodPOST
Response dataCancel a specific ticket.

Request example

JSON
{
“ticket": "TICKET_ID"
}
}

Response example

JSON
{
"success": true/false
}

Settings

Get Settings

ItemValue
URLBASE_URI/RESPONSE_FORMAT/settings/get
HTTP methodGET
Response dataGet Virtual ticket settings

Response example

JSON
{
"success": true/false,
"settings": [
{
"id": "vt_max_radius",
"value": "50"
}
]
}