Notification Process
Below is a diagram of the notification process.
Step ➀ – Registering the pushID
The company's application registers the pushID by the development server.
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
orTICKET_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
Action | Description |
---|---|
TICKET_BOOKED | The ticket is booked. |
TICKET_ALERTED | It is soon the client's turn, s/he receives an alert. |
TICKET_CALLED | It is now the client's turn, s/he is called. |
TICKET_ONHOLD | The client did not show up, the ticket is pending. |
TICKET_NOSHOW | The client did not show up; the ticket is no longer valid. |
TICKET_INPROGRESS | The client came and progressed in the queue. |
TICKET_CANCELED | The client did not came; the ticket was canceled. |
TICKET_DONE | The client came; the ticket was used and is no longer valid. |
TICKET_REMIND_12345 | This 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
Code | Description |
---|---|
200 | Returns nothing, successful subscription. |