# Fleet

Part of the [GeoDynamics API](/api/geodynamics/index.md). Host: `https://api.geodynamics.dev`.

## POST /intellitracer/v1/eco/speedings

`https://api.geodynamics.dev/intellitracer/v1/eco/speedings`

Privilege required: `Api: Eco speeding`

Get Speedings

Returns a list of all speedings by users or vehicles within a date/time range. Provide either some user id's or vehicle id's to identify resources.

### Request body

Type: `object`

| Field | Type | Required |
| --- | --- | --- |
| `From` | string | required |
| `To` | string | required |
| `UserIds` (default = []) | array | optional |
| `VehicleIds` (default = []) | array | optional |

### Responses

#### 200: OK

```json
[
  {
    "DateTime": "2019-03-12T11:00:51+01:00",
    "VehicleId": "00000000-0000-0000-0000-000000000000",
    "VehicleName": "Vehicle 1",
    "VehicleLicensePlate": "1-ABC-123",
    "DriverId": "00000000-0000-0000-0000-000000000000",
    "DriverName": "John Doe",
    "Speed": 121,
    "MaxSpeed": 100,
    "Fine": 65,
    "Revocation": false,
    "TooltipEn": null,
    "TooltipFr": null,
    "TooltipNl": null
  }
]
```

#### 401: Unauthorized

#### 403: Forbidden

## POST /intellitracer/v1/eco/driveridentification

`https://api.geodynamics.dev/intellitracer/v1/eco/driveridentification`

Privilege required: `Api: Eco driveridentfication`

Create driver identification

Creates a new driver identification.

### Request body

Type: `object`

| Field | Type | Required |
| --- | --- | --- |
| `UserCode` | string | required |
| `VehicleCode` | string | required |
| `StartDateTime` | string | required |

### Responses

#### 200: OK

#### 400: BadRequest

| Field | Type |
| --- | --- |
| `UserCode` | string |
| `VehicleCode` | string |
| `StartDateTime` | string |

```json
{
  "UserCode": "012345",
  "VehicleCode": "012345",
  "StartDateTime": "2019-03-12T11:00:51+01:00"
}
```

#### 401: Unauthorized

#### 403: Forbidden

#### 417: ExpectationFailed

#### 500: InternalServerError

## POST /intellitracer/v1/eco/importfueltransactions

`https://api.geodynamics.dev/intellitracer/v1/eco/importfueltransactions`

Privilege required: `Api: Eco import fuel transactions`

Import fuel transactions

Imports one or more fuel transactions.

### Request body

Type: `object`

| Field | Type | Required |
| --- | --- | --- |
| `FuelTransactions` (default = []) | array | optional |

### Responses

#### 200: OK

#### 400: BadRequest

```json
[
  {
    "Entity": {
      "TrackingDeviceId": "1000000000",
      "TransactionNumber": "1",
      "Timestamp": "2019-01-23T04:56:07",
      "Liters": 65.5,
      "Price": 70.4,
      "Source": "1000",
      "Mileage": 1245.4
    },
    "ValidationResult": [
      {
        "Message": "",
        "SourceMemberNames": []
      }
    ]
  }
]
```

#### 401: Unauthorized

#### 403: Forbidden

#### 417: ExpectationFailed

## POST /intellitracer/v1/fleet/fueltransactions

`https://api.geodynamics.dev/intellitracer/v1/fleet/fueltransactions`

Privilege required: `Api: Fleet`

Get fuel transactions

Returns a list of fuel transactions, optionally filtered by users, vehicles, fuel pumps and/or fuel tanks.

### Query parameters

| Name | Type | Required | Example |
| --- | --- | --- | --- |
| `fromDate` | string | required | `2019-01-17T00:00:00` |
| `toDate` | string | required | `2019-01-18T23:59:59` |

### Request body

Type: `object`

| Field | Type | Required |
| --- | --- | --- |
| `Users` (default = []) | array | optional |
| `Resources` (default = []) | array | optional |
| `Tanks` (default = []) | array | optional |
| `Pumps` (default = []) | array | optional |
| `UnlinkedTransactions` (default = false) | boolean | optional |

### Responses

#### 200: OK

```json
[
  {
    "DateTime": "2019-01-25T08:29:37",
    "FuelTank": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Tank",
      "Capacity": 1500,
      "Limit": 1500,
      "CurrentLevel": 1500,
      "FuelType": 1,
      "FuelTypeName": "Diesel"
    },
    "FuelPump": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Pump",
      "Code": "1500",
      "FuelType": 1,
      "FuelTypeName": "Diesel",
      "Type": 1,
      "TypeName": "VehicleCode_Info"
    },
    "User": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "John Doe",
      "Code": "012345"
    },
    "Vehicle": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Vehicle 1",
      "Code": "012345",
      "LicensePlate": "1-ABC-123"
    },
    "TransactionNumber": "00000000",
    "Price": 10,
    "Liters": 10,
    "KmVehicle": 10,
    "KmUser": 10,
    "KmDriven": 0,
    "AvgConsumption": 0,
    "Type": "Bijtanken",
    "Info": "",
    "VehicleIdentification": "500145"
  }
]
```

#### 401: Unauthorized

#### 403: Forbidden

## GET /intellitracer/v2/fleet/fuelsensors?page={page}&search={search}

`https://api.geodynamics.dev/intellitracer/v2/fleet/fuelsensors?page={page}&search={search}`

Privilege required: `Api: Fleet`

Get fuel sensors

Returns a paged list of fuelsensors.

Pagination and searching is explained in [Pagination](#pagination).

### Path parameters

| Name | Type | Required | Example |
| --- | --- | --- | --- |
| `page` | number | required | `1` |
| `search` | string | required | `ABC` |

### Responses

#### 200: OK

| Field | Type |
| --- | --- |
| `Data` | array |
| `PagingFilter` | object |

```json
{
  "Data": [
    {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "Name",
      "FuelSensorType": 0,
      "FuelType": 0,
      "LatestMeasurement": "2021-07-12T08:29:37+02:00",
      "CurrentLevel": 25,
      "CurrentVolume": 686,
      "MaximumVolume": 2541,
      "Longitude": 50.45161,
      "Latitude": 3.45161,
      "StationName": "StationName",
      "Batterylevel": 95,
      "Low": 210,
      "High": 2000
    }
  ],
  "PagingFilter": {
    "Page": 1,
    "Search": "ABC",
    "PageCount": 4,
    "TotalCount": 100,
    "Links": {
      "Base": "https://api.geodynamics.dev",
      "First": "/intellitracer/v2/asset?page=1",
      "Prev": "/intellitracer/v2/asset?page=2",
      "Next": "/intellitracer/v2/asset?page=4",
      "Last": "/intellitracer/v2/asset?page=4"
    }
  }
}
```

#### 401: Unauthorized

#### 403: Forbidden

## POST /intellitracer/v1/fleet/vehicleusagegetbyuseridsdaterange

`https://api.geodynamics.dev/intellitracer/v1/fleet/vehicleusagegetbyuseridsdaterange`

Privilege required: `Api: Fleet`

Get vehicle usage

Returns a list of vehicle usages by person.

### Query parameters

| Name | Type | Required | Example |
| --- | --- | --- | --- |
| `fromDate` | string | required | `2019-01-17T00:00:00+01:00` |
| `toDate` | string | required | `2019-01-18T23:59:59+01:00` |
| `includeClockings` | boolean | optional | `false` |
| `includeStops` | boolean | optional | `false` |
| `includeDrivings` | boolean | optional | `false` |

### Request body

### Responses

#### 200: OK

```json
[
  {
    "User": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "Name": "John Doe",
      "Code": "012345",
      "EmployerCode": "012345",
      "Email": "john.doe@doe.com",
      "Gsm": "+32477665544",
      "FreeField1": null,
      "FreeField2": null,
      "FreeField3": null,
      "FreeField4": null,
      "FreeField5": null,
      "FreeField6": null,
      "Notes": null,
      "Street": "Dumolinlaan",
      "HouseNumber": "9",
      "City": "Kortrijk",
      "PostalCode": "8500",
      "Submunicipality": "Kortrijk",
      "Country": 0,
      "Longitude": 3.245304,
      "Latitude": 50.812939,
      "DefaultDayProgram": {
        "Id": "00000000-0000-0000-0000-000000000000",
        "Name": "Default"
      },
      "Groups": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "Name": "Employees",
          "Type": 0,
          "Code": "012345"
        }
      ]
    },
    "Days": [
      {
        "Date": "2019-01-17T00:00:00",
        "VehicleUsages": [
          {
            "Vehicle": {
              "Id": "00000000-0000-0000-0000-000000000000",
              "Name": "Vehicle 1",
              "IvrCode": null,
              "Code": "012345",
              "Category": 0,
              "FuelType": "1",
              "Co2Emission": 80,
              "RowOfSeatsCount": 2,
              "SeatsCount": 5,
              "LicensePlate": "1-ABC-123",
              "VinNumber": "ABCDE01234F567890",
              "HasTrackingData": false,
              "LastReportDate": "2019-03-19T11:45:47+01:00",
              "LastSyncDate": "2019-03-19T11:45:47+01:00",
              "UserNotes": null,
              "Weight": 600,
              "EmissionStandard": "300",
              "MaximumSpeed": 220,
              "NominalConsumption": 5.5,
              "CostCenter": {
                "Id": "00000000-0000-0000-0000-000000000000",
                "Name": "Workplace 1",
                "Code": "012345",
                "Poi": {
                  "Id": "00000000-0000-0000-0000-000000000000",
                  "Name": "Work",
                  "Code": "012345",
                  "PoiType": {
                    "Id": "00000000-0000-0000-0000-000000000000",
                    "Name": "Work place",
                    "Color": "#00FF2F"
                  },
                  "IsAssetLocation": false,
                  "Street": "Dumolinlaan",
                  "HouseNumber": "9",
                  "City": "Kortrijk",
                  "Submunicipality": "Kortrijk",
                  "PostalCode": "8500",
                  "Country": 0,
                  "Priority": "0",
                  "Description": "Work",
                  "GeographyWkt": "POLYGON ((3.145219 50.81309, 3.244998 50.81309, 3.244998 50.91806, 3.145219 50.91806, 3.145219 50.81309))",
                  "LonMin": 3.145219,
                  "LonMax": 3.244998,
                  "LatMin": 50.81309,
                  "LatMax": 50.91806,
                  "MarkerLon": 3.145219,
                  "MarkerLat": 50.81309,
                  "IsLambert72": false,
                  "Radius": 0.03,
                  "ReverseGeocoding": false,
                  "Groups": [
                    {
                      "Id": "00000000-0000-0000-0000-000000000000",
                      "Name": "Work places",
                      "Pois": [
                        {}
                      ],
                      "NumberOfPois": 1
                    }
                  ]
                }
              },
              "Groups": [
                {
                  "Id": "00000000-0000-0000-0000-000000000000",
                  "Name": "Employees",
                  "Type": 0,
                  "Code": "012345"
                }
              ]
            },
            "MileageTotal": 236.5,
            "TotalPowerLost": 0,
            "Mileage": 5650.406,
            "Clockings": [
              {
                "User": {
                  "Id": "00000000-0000-0000-0000-000000000000",
                  "Name": "John Doe",
                  "Code": "012345",
                  "EmployerCode": "012345",
                  "Email": "john.doe@doe.com",
                  "Gsm": "+32477665544",
                  "FreeField1": null,
                  "FreeField2": null,
                  "FreeField3": null,
                  "FreeField4": null,
                  "FreeField5": null,
                  "FreeField6": null,
                  "Notes": null,
                  "Street": "Dumolinlaan",
                  "HouseNumber": "9",
                  "City": "Kortrijk",
                  "PostalCode": "8500",
                  "Submunicipality": "Kortrijk",
                  "Country": 0,
                  "Longitude": 3.245304,
                  "Latitude": 50.812939,
                  "DefaultDayProgram": {
                    "Id": "00000000-0000-0000-0000-000000000000",
                    "Name": "Default"
                  },
                  "Groups": [
                    {
                      "Id": "00000000-0000-0000-0000-000000000000",
                      "Name": "Employees",
                      "Type": 0,
                      "Code": "012345"
                    }
                  ]
                },
                "DateTime": "2019-01-17T06:02:03+01:00"
              }
            ],
            "Stops": [
              {
                "Location": "Dumolinlaan 9, 8500 Kortrijk [Kortrijk], BE",
                "Pois": [
                  {
                    "Id": "00000000-0000-0000-0000-000000000000",
                    "Name": "Work"
                  }
                ],
                "From": "2019-01-17T06:57:53+01:00",
                "To": "2019-01-17T08:41:43+01:00"
              }
            ],
            "Drivings": [
              {
                "From": "2019-01-17T06:57:53+01:00",
                "To": "2019-01-17T08:41:43+01:00"
              }
            ]
          }
  
...
```

_Example truncated._

#### 401: Unauthorized

#### 403: Forbidden

## POST /intellitracer/v1/fleet/vehiclewithdriver

`https://api.geodynamics.dev/intellitracer/v1/fleet/vehiclewithdriver`

Privilege required: `Api: Fleet`

Update vehicle and create driver identification

Updates a vehicle by tracking device unit id and creates a new driver identification by user code.

If necessary, a new user and/or user group is created before creating a driver identification.

### Request body

Type: `object`

| Field | Type | Required |
| --- | --- | --- |
| `TrackingDeviceId` The unique vehicle unit id. | string | required |
| `VehicleName` | string | required |
| `Licenseplate` (default = null) | string | optional |
| `Vin` (default = null) | string | optional |
| `FuelType` | string | required |
| `FuelConsumption` (default = 0.0) | number | optional |
| `UserName` | string | required |
| `UserCode` The user and user group code seperated by `/`. | string | required |
| `DriverStart` | string | required |

### Responses

#### 200: OK

#### 400: BadRequest

| Field | Type |
| --- | --- |
| `Entity` | object |
| `ValidationResult` | array |

```json
{
  "Entity": {
    "TrackingDeviceId": "1000000000",
    "VehicleName": "Vehicle 1",
    "Licenseplate": "1-ABC-123",
    "Vin": "ABCDE01234F567890",
    "FuelType": "d",
    "FuelConsumption": 5.5,
    "UserName": "John Doe",
    "UserCode": "012345/9876",
    "DriverStart": "2019-01-24T17:00:00"
  },
  "ValidationResult": [
    {
      "Message": "",
      "SourceMemberNames": []
    }
  ]
}
```

#### 401: Unauthorized

#### 403: Forbidden

#### 417: ExpectationFailed

#### 500: InternalServerError

## GET /intellitracer/v2/transportticketsbydate?date={date}

`https://api.geodynamics.dev/intellitracer/v2/transportticketsbydate?date={date}`

Privilege required: `Api: Fleet`

Get transport tickets by date

Returns a list of all the tickets from the given date.

### Path parameters

| Name | Type | Required | Example |
| --- | --- | --- | --- |
| `date` | string | required | `2020-01-01` |

### Responses

#### 200: OK

| Field | Type |
| --- | --- |
| `Data` (default = null) | array |
| `ValidationResult` | array |

```json
{
  "Data": [
    {
      "Id": "00000000-0000-0000-0000-000000000000",
      "TransportTicketUser": {
        "Id": "00000000-0000-0000-0000-000000000000",
        "Name": "John Doe",
        "UserTypes": [
          0
        ],
        "VehicleType": {
          "Id": "00000000-0000-0000-0000-000000000000",
          "Name": "Vehicle Type"
        },
        "InternalCode": "0123456789",
        "Email": "johndoe@company.com",
        "PhoneNumber": "+32123456789"
      },
      "TransportTicketCompany": {
        "Id": "00000000-0000-0000-0000-000000000000",
        "Name": "John Doe",
        "Vat": "0123456789",
        "Email": "johndoe@company.com"
      },
      "Date": "2021-07-12T08:29:37",
      "Pause": {
        "Enabled": true,
        "Value": "01:00:00",
        "Remark": "remark"
      },
      "Return": {
        "Enabled": true,
        "Value": "01:00:00",
        "Remark": "remark"
      },
      "Total": "01:00:00",
      "TransporterInfo": {
        "AlreadyLoaded": true,
        "Mileage": 107
      },
      "CreationTime": "2021-07-12T08:29:37",
      "Registrations": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "Type": 0,
          "Remark": "remark",
          "Arrival": "2021-07-12T08:29:37",
          "Departure": "2021-07-12T08:29:37",
          "SubmitTimeStamp": "2021-07-12T08:29:37",
          "Poi": {
            "Id": "00000000-0000-0000-0000-000000000000",
            "Name": "Work",
            "Code": "012345"
          },
          "WorkplaceNumber": "12345",
          "StartReference": {},
          "TransporterInfo": {
            "MachineNumber": "12345",
            "Counter": 107
          },
          "Address": {
            "CountryName": "Belgium",
            "AddressLine": "Dumolinlaan 9, 8500 Kortrijk, BE",
            "PoiList": [
              "00000000-0000-0000-0000-000000000000",
              "00000000-0000-0000-0000-000000000000"
            ],
            "City": "Kortrijk",
            "CityLine": "8500 Kortrijk, BE",
            "CountryCode": 0,
            "HouseNumber": "9",
            "Latitude": 50.812939,
            "Longitude": 3.245304,
            "PostalCode": "8500",
            "ShortAddressLine": "Dumolinlaan 9, Kortrijk, BE",
            "Street": "Dumolinlaan",
            "StreetLine": "Dumolinlaan 9",
            "Submunicipality": "Kortrijk"
          }
        }
      ],
      "TransportTicketUserType": 0
    }
  ],
  "ValidationResult": [
    {
      "Message": "",
      "SourceMemberNames": []
    }
  ]
}
```

#### 401: Unauthorized

#### 403: Forbidden
