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?
| Item | Value |
|---|---|
| BASE_URI | http://virtual-ticket-server.com/vt/api |
| RESPONSE_FORMAT | - XML |
| - JSON |
Users and Authentication
Register
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/register |
| HTTP method | POST |
| Response data | Register a new user |
Request options
| Item | Value |
|---|---|
| oauth_provider | Can be Google, Facebook, or null. |
| oauth_token | Null if oauth_provider is null. |
| username | Customer’s username. |
| password | Customer’s password. |
| Customer’s email. | |
| phone | Customer’s phone number. |
| pushnotification | Customer’s push notification key. |
| first_name | Customer’s first name. |
| last_name | Customer’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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/login |
| HTTP method | POST |
| Response data | Log 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/details |
| HTTP method | POST |
| Response data | Get 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/resetpassword |
| HTTP method | GET |
| Response data | True or false |
Query parameters
| Item | Value |
|---|---|
| Mandatory parameter, string. |
Response example
JSON
{
"success": true/false,
}
Customer new password
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/newpassword |
| HTTP method | POST |
| Response data | True 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/locations/get |
| HTTP method | GET |
| Response data | Get a list of locations and their info, including services and tickets. |
Query parameters
| Item | Value |
|---|---|
| region | Can be a string. |
| city | Can be a string. |
| coordinates | Can 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/server_services/get |
| HTTP method | GET |
| Response data | Get a list of server_services and their info. |
Query parameters
| Item | Value |
|---|---|
| server_service_id | Can be a string or null. |
| location_id | Can 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/customer/tickets/ticket_id |
| HTTP method | GET |
| Response data | Get 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/ticket/create |
| HTTP method | POST |
| Response data | Create 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
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/ticket/cancel |
| HTTP method | POST |
| Response data | Cancel a specific ticket. |
Request example
JSON
{
“ticket": "TICKET_ID"
}
}
Response example
JSON
{
"success": true/false
}
Settings
Get Settings
| Item | Value |
|---|---|
| URL | BASE_URI/RESPONSE_FORMAT/settings/get |
| HTTP method | GET |
| Response data | Get Virtual ticket settings |
Response example
JSON
{
"success": true/false,
"settings": [
{
"id": "vt_max_radius",
"value": "50"
}
]
}