Skip to main content

Notification Process

Below is a diagram of the notification process.

Ticket Notifications

Step ➀ – Registering the pushID

The company's application registers the pushID by the development server.

Security

The push ID is a reference to identify the device on which the application runs. It must be unique for each user (and preferably for each device too). It can be the iOS/Android push ID but we do not recommend it.

Steps ➁ Transmitting the pushID

The second step consists in subscribing to the notification service each time a ticket gets booked.

The pushID is transmitted directly to the Lineberty API.

Step ➂ – Sending the Information

If an event occurred for a ticket, such as a client booked a ticket, a ticket has been called, a ticket has been postponed,... the Lineberty API sends a message to the development server, containing the push ID and information about the ticket.

This information is:

  • An action: TICKET_BOOKED, TICKET_ALERTED, TICKET_CALLED, TICKET_ONHOLD, TICKET_NOSHOW, TICKET_INPROGRESS, TICKET_CANCELED or TICKET_DONE.
  • A content: The message that is displayed to the user. For example: "Dear Client, it's now your turn, please go to counter 3".
  • Data: A JSON object containing the ticket information (ID, label, date, etc.)

Possible Actions

ActionDescription
TICKET_BOOKEDThe ticket is booked.
TICKET_ALERTEDIt is soon the client's turn, s/he receives an alert.
TICKET_CALLEDIt is now the client's turn, s/he is called.
TICKET_ONHOLDThe client did not show up, the ticket is pending.
TICKET_NOSHOWThe client did not show up; the ticket is no longer valid.
TICKET_INPROGRESSThe client came and progressed in the queue.
TICKET_CANCELEDThe client did not came; the ticket was canceled.
TICKET_DONEThe client came; the ticket was used and is no longer valid.
TICKET_REMIND_12345This event is a set of messages managed by Lineberty, which is sent to the user under certain conditions (the day before the appointment, 2 hours before the appointment, etc.). The event name consists of two parts. The first one is static "TICKET_REMIND" and the second is a numerical ID to differentiate all the possible TICKET_REMIND.

Example of Message

The data is identical to the ticket data returned by POST /queues/{queueId}/ticket. Note that the parameters sendClientMail, sendClientPush, and sendClientSms are set to 'true' to indicate that the user wants to be notified by email, push and SMS. They all require the phone, mail and pushID to be specified.

{
"pushId": "USER_PUSH_ID",
"message": {
"action": "TICKET_BOOKED",
"content": "Welcome! You have taken ticket 12. Your turn is scheduled for 2:00 PM.",
"data" : {
// The data contained in the `tickets` object
// of the response to GET /user/tickets
// View at https://api-booking.lineberty.net/v2/user/tickets
}

}
}
}

Step ➃ – Pushing the Notification

The development server can now push the notifications. Using the push ID, it will be able to know to which application it has to push the message.

Responses to the Subscription

CodeDescription
200Returns nothing, successful subscription.