Fahrtenbuch

Reports

Get the monthly report

GET
/reports/monthly

Gleicher Inhalt wie der Monatsbericht per E-Mail: alle eigenen und freigegebenen Fahrzeuge (bei freigegebenen nur die eigenen Fahrten), offene Fahrten und Orte, die im Monat zum ersten Mal angefahren wurden. Monatsgrenzen in der Ortszeit der Fahrt.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Query Parameters

month?string

YYYY-MM, Standard ist der Vormonat in der Kontozeitzone.

Match^\d{4}-(0[1-9]|1[0-2])$

Response Body

Monatsbericht

application/json
  1. response
month?string
from?string
Formatdate
to?string
Formatdate
timeZone?string
distanceUnit?string

Anzeigeeinheit des Benutzers; alle Werte sind in km

Value in"km""mi"
isEmpty?boolean

Keine Fahrten im Monat und keine offenen Fahrten – es wird keine Mail versendet

totals?
vehicles?array<>
openTrips?array<>
olderOpenTripCount?integer

Offene Fahrten aus früheren Monaten

newPlaces?array<>

Ziele, die im Monat erstmals angefahren wurden (vorher keine Fahrt im Erkennungsradius), unabhängig davon, ob sie gespeichert sind.

Example Request
curl -X GET 'https://example.com/api/v1/reports/monthly'
Example Response
{  "month": "string",  "from": "2019-08-24",  "to": "2019-08-24",  "timeZone": "string",  "distanceUnit": "km",  "isEmpty": true,  "totals": {    "drivenKm": 0,    "businessKm": 0,    "tripCount": 0,    "openTripCount": 0,    "openKm": 0  },  "vehicles": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "licensePlate": "string",      "access": "owner",      "ownerName": "string",      "tripCount": 0,      "openTripCount": 0,      "drivenKm": 0,      "actualKm": 0,      "trackedKm": 0,      "businessKm": 0,      "privateKm": 0,      "commuteKm": 0,      "unclassifiedKm": 0,      "otherDriversKm": 0,      "unexplainedKm": 0,      "endOdometerKm": 0    }  ],  "openTrips": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "vehicleId": "c406adf4-e700-4483-ad7a-e7447a2941cb",      "vehicleName": "string",      "startedAt": "2019-08-24T14:15:22Z",      "endedAt": "2019-08-24T14:15:22Z",      "localStart": "string",      "localEnd": "string",      "startAddress": "string",      "endAddress": "string",      "distanceKm": 0,      "suggestion": {        "type": "business",        "reason": "string",        "source": "places",        "confidence": 0,        "historyCount": 0,        "historyTotal": 0,        "provider": "string",        "purpose": "string",        "contact": "string",        "startPlace": {},        "endPlace": {}      }    }  ],  "olderOpenTripCount": 0,  "newPlaces": [    {      "key": "string",      "address": "string",      "latitude": 0,      "longitude": 0,      "firstVisit": "2019-08-24",      "tripCount": 0,      "distanceKm": 0,      "openTripCount": 0,      "mainType": "business",      "purpose": "string",      "savedPlace": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string"      }    }  ]}
POST
/reports/monthly/send

Zum Testen und Debuggen: sendet den Bericht sofort, auch für einen leeren Monat. Nur verfügbar, wenn features.monthlyReportSendNow aktiv ist (Standard im dev-Image, sonst 404 FEATURE_DISABLED).

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
month?string

Response Body

Gesendet

application/json
  1. response
sent?boolean
to?|
Formatemail
month?string
Example Request
curl -X POST 'https://example.com/api/v1/reports/monthly/send' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "sent": true,  "to": "user@example.com",  "month": "string"}