Webhook

To add a webhook to LubeLogger, you just have to add the WebHook URL in the Server Settings Configurator

Example payload:

Triggers:

  • Vehicle - Create/Edit/Delete
  • Service Record/Repair/Upgrade - Create/Edit/Delete/Move/Adjust Odometer/Duplicate
  • Odometer - Create/Edit/Delete/Adjust Odometer/Duplicate
  • Fuel/Tax/Supply/Notes/Reminders - Create/Edit/Delete/Duplicate

Adding records via the API will also trigger the above webhook.

Discord Webhook

LubeLogger supports using Discord Chatrooms as a webhook as of 1.4.2, to use Discord as a webhook, change the https:// in the beginning of the webhook URL to discord://

https://discord.com/api/webhooks/...

will turn into

discord://discord.com/api/webhooks/...

Example Discord Webhook Payload:

WebSocket

Web sockets allows multiple external applications to subscribe to events, unlike webhooks which only allows for one subscriber at a time. Web Sockets also enables real-time sync within LubeLogger which is the ideal approach for Kiosk mode.

Web socket can be enabled in the Server Settings Configurator

Testing WebSocket Connection

Web sockets are implemented through SignalR hubs, which provides fallbacks such as SSE and long-polling if operating under unsupported environments. For this example, we will assume that web sockets are enabled and supported.

In PostMan(or your preferred RestApi tester), select WebSocket as the connection type:

If authentication is enabled, you will need to generate an api key(viewer permission) and append it. If your LubeLogger instance is served over a https connection, use wss:// otherwise use ws://

Example URL:

wss://your/lubelogger/domain/api/ws?apiKey=<apiKey>

Click connect and it should succeed

You will then send a few messages to set the protocol and join either one of these groups:

  • kiosk
  • vehicleId_{id of the vehicle}

The kiosk group allows you to subscribe to changes across all vehicles in the your garage, where as the vehicleId_{id of the vehicle} group allows you to subscribe to changes only from that vehicle.

Because the messages contains the non-printing character 0x1e (RS), they can be found on this gist instead of being in this wiki.

This message sets the protocol

After sending this, you will start receiving heartbeats from the websocket

This message joins the kiosk group

After sending this, you will start receiving events for all vehicles in the garage.

This message joins the group for vehicleId 1

If you're already joining the kiosk group, joining the vehicleId groups is redundant.

Notes on WebSocket Security

Unlike webhooks which publishes all events for all vehicles to a centralized endpoint, users will only receive events based on the vehicles they have access to. An API Key generated by a root user will have receive events from all vehicles in the system.

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9