hargata/lubelog

Webhooks - "nicer" machine payloads

psyciknz opened this issue · 0 comments

Any chance of simpler machine readable payloads.

Eg Adding a gas record is:

{
   "vehicleid": 1,
   "user": "psyciknz",
   "action": "Created Gas Record - Mileage: 129968"
}

where itd be real helpful if it could be, or include the following (and thinkinf of backwards compatibility here)

{
   "vehicleid": 1,
   "user": "psyciknz",
   "action": "Created Gas Record - Mileage: 129968",
   "type": "Created Gas Record"
   "value": {
          "Mileage": 129968
   }
}

and say for your example in the web hook docs

{
   "vehicleid": 1,
   "user": "psyciknz",
   "action": "Edited Service Record - Description: Oil Change",
   "type": "Edited Service Record"
   "value": {
          "Description": "Oil Change"
   }
}

thoughts? I'm seeing if I can work on a two way fuel record in lubelogger, updates traccar for the same device with the recorded odometer.

Potentially from traccar > device offline > update odometer record in lubelogger.
I'm actually using Home assistant as the engine to consume the lubelogger web hook.