Ticket created
.onTicketCreated(filter, callback)

Will execute callback function when new ticket is created. Callback function will be executed with a created ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketCreated({"line": 123}, function(ticket) {
  console.log("New ticket: ", ticket);
});
Ticket called
.onTicketCalled(filter, callback)

Will execute callback function when ticket is called. Callback function will be executed with a called ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketCalled({"location": 54}, function(ticket) {
  console.log("Ticket called: ", ticket);
});
Ticket recalled
.onTicketRecalled(filter, callback)

Will execute callback function when ticket is recalled. Callback function will be executed with a recalled ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketRecalled(function(ticket) {
  console.log("Ticket recalled: ", ticket);
});
Ticket cancelled
.onTicketCancelled(filter, callback)

Will execute callback function when ticket is cancelled. Callback function will be executed with a cancelled ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketCancelled({"line": 4432}, function(ticket) {
  console.log("Ticket cancelled: ", ticket);
});
Ticket served
.onTicketServed(filter, callback)

Will execute callback function when ticket is served. Callback function will be executed with a served ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketServed({"line": 4432}, function(ticket) {
  console.log("Ticket served: ", ticket);
});
Ticket changed
.onTicketChanged(filter, callback)

Will execute callback function when ticket is changed (label added, label removed or tickets fields changed). Callback function will be executed with a changed ticket as an only argument.
Filter can be a Javascript object with field "line" or field "location". Also filter can be omitted.

Example

Qminder.events.onTicketChanged({"line": 4431}, function(ticket) {
  console.log("Ticket changed: ", ticket);
});