Tenix Open Data Platform API - GraphQL Documentation

Historical data API

API Endpoints
# Tenix Open Data Platform API:
https://openapi.platform.tenix.eu/graphql

Queries

journey

Response

Returns a JourneyQueries!

Example

Query
query Journey {
  journey {
    searchJourneySummaries {
      totalCount
      items {
        ...JourneySummaryFragment
      }
    }
  }
}
Response
{
  "data": {
    "journey": {
      "searchJourneySummaries": JourneySummaryPage
    }
  }
}

organization

Response

Returns an OrganizationQueries!

Example

Query
query Organization {
  organization {
    getOrganization {
      companies {
        ...CompanyFragment
      }
    }
  }
}
Response
{
  "data": {
    "organization": {"getOrganization": Organization}
  }
}

schedule

Response

Returns a ScheduleQueries!

Example

Query
query Schedule {
  schedule {
    searchScheduledJourneys {
      depotId
      blockId
      day
      distance
      line
      startPoint {
        ...JourneyPointFragment
      }
      endPoint {
        ...JourneyPointFragment
      }
      points {
        ...JourneyPointFragment
      }
      externalId
    }
    searchAssignedJourneys {
      depotId
      blockId
      day
      registeredAt
      vehicleNumber
      distance
      line
      startPoint {
        ...JourneyPointFragment
      }
      endPoint {
        ...JourneyPointFragment
      }
      points {
        ...JourneyPointFragment
      }
      type
      externalId
    }
    findAssignedJourney {
      depotId
      blockId
      day
      registeredAt
      vehicleNumber
      distance
      line
      startPoint {
        ...JourneyPointFragment
      }
      endPoint {
        ...JourneyPointFragment
      }
      points {
        ...JourneyPointFragment
      }
      type
      externalId
    }
  }
}
Response
{
  "data": {
    "schedule": {
      "searchScheduledJourneys": [ScheduledJourney],
      "searchAssignedJourneys": [AssignedJourney],
      "findAssignedJourney": AssignedJourney
    }
  }
}

telemetry

Response

Returns a TelemetryQueries!

Example

Query
query Telemetry {
  telemetry {
    findDailyVehicleTelemetry {
      vehicleId {
        ...VehicleIdFragment
      }
      date
      odometerCan {
        ...FloatMetricFragment
      }
      odometerGps {
        ...FloatMetricFragment
      }
      totalFuelConsumed {
        ...FloatMetricFragment
      }
      engineTotalHours {
        ...IntMetricFragment
      }
    }
  }
}
Response
{
  "data": {
    "telemetry": {
      "findDailyVehicleTelemetry": [DailyVehicleTelemetry]
    }
  }
}

vehicle

Response

Returns a VehicleQueries!

Example

Query
query Vehicle {
  vehicle {
    searchVehicles {
      id
      companyId
      internalNumber
      divisionId
      fuelType
      bmsId
      vin
      model
      make
      vehicleType
      devices {
        ...VehicleDeviceFragment
      }
      batteryKwh
      consumptionPerKm
      deleted
      svv
    }
  }
}
Response
{"data": {"vehicle": {"searchVehicles": [Vehicle]}}}

Mutations

schedule

Response

Returns a ScheduleMutations!

Example

Query
mutation Schedule {
  schedule {
    registerScheduledJourneys
    removeScheduledJourneys {
      removedJourneys
      errors
    }
    assignVehicleJourneys
    removeVehicleJourneys {
      removedJourneys
      errors
    }
    assignJourneys
    reassignJourneys
    removeAssignedJourney
  }
}
Response
{
  "data": {
    "schedule": {
      "registerScheduledJourneys": [
        "abc123"
      ],
      "removeScheduledJourneys": RemoveScheduledJourneysResult,
      "assignVehicleJourneys": ["abc123"],
      "removeVehicleJourneys": RemoveVehicleJourneysResult,
      "assignJourneys": false,
      "reassignJourneys": 123,
      "removeAssignedJourney": false
    }
  }
}

vehicle

Response

Returns a VehicleMutations!

Example

Query
mutation Vehicle {
  vehicle {
    createVehicle {
      message
      id
    }
    updateVehicle {
      message
      id
    }
  }
}
Response
{
  "data": {
    "vehicle": {
      "createVehicle": VehicleResult,
      "updateVehicle": VehicleResult
    }
  }
}

Types

AssignJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
journeys - [JourneyInput!]!
Example
{
  "companyId": "xyz789",
  "depotId": "xyz789",
  "blockId": "xyz789",
  "day": "2007-12-03",
  "journeys": [JourneyInput]
}

AssignVehicleJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
assignments - [VehicleAssignment!]!
allowOverassignment - Boolean
receivedAt - DateTime!
Example
{
  "companyId": "abc123",
  "depotId": "abc123",
  "blockId": "xyz789",
  "day": "2007-12-03",
  "assignments": [VehicleAssignment],
  "allowOverassignment": true,
  "receivedAt": "2007-12-03T10:15:30Z"
}

AssignedJourney

Fields
Field Name Description
depotId - String!
blockId - String!
day - DateTime!
registeredAt - DateTime!
vehicleNumber - String!
distance - Int!
line - String
startPoint - JourneyPoint!
endPoint - JourneyPoint!
points - [JourneyPoint!]!
type - JourneyType!
externalId - String
Example
{
  "depotId": "abc123",
  "blockId": "abc123",
  "day": "2007-12-03T10:15:30Z",
  "registeredAt": "2007-12-03T10:15:30Z",
  "vehicleNumber": "abc123",
  "distance": 123,
  "line": "xyz789",
  "startPoint": JourneyPoint,
  "endPoint": JourneyPoint,
  "points": [JourneyPoint],
  "type": "SERVICE",
  "externalId": "abc123"
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

CacheControlScope

Values
Enum Value Description

PUBLIC

PRIVATE

Example
"PUBLIC"

Company

Fields
Field Name Description
id - String!
name - String!
active - Boolean!
divisions - [Division!]!
depots - [Depot!]!
Example
{
  "id": "abc123",
  "name": "abc123",
  "active": true,
  "divisions": [Division],
  "depots": [Depot]
}

CreateVehicleInput

Fields
Input Field Description
companyId - String!
vehicleMetadata - VehicleMetadata!
Example
{
  "companyId": "abc123",
  "vehicleMetadata": VehicleMetadata
}

DailyVehicleTelemetry

Fields
Field Name Description
vehicleId - VehicleId!
date - Date!
odometerCan - FloatMetric
odometerGps - FloatMetric
totalFuelConsumed - FloatMetric
engineTotalHours - IntMetric
Example
{
  "vehicleId": VehicleId,
  "date": "2007-12-03",
  "odometerCan": FloatMetric,
  "odometerGps": FloatMetric,
  "totalFuelConsumed": FloatMetric,
  "engineTotalHours": IntMetric
}

Date

Example
"2007-12-03"

DateTime

Example
"2007-12-03T10:15:30Z"

Depot

Fields
Field Name Description
id - String!
name - String!
active - Boolean!
Example
{
  "id": "xyz789",
  "name": "abc123",
  "active": false
}

Division

Fields
Field Name Description
id - String!
name - String!
active - Boolean!
Example
{
  "id": "abc123",
  "name": "xyz789",
  "active": true
}

Driver

Fields
Field Name Description
id - String!
name - String
team - String
Example
{
  "id": "xyz789",
  "name": "xyz789",
  "team": "xyz789"
}

EcoDriveSummary

Fields
Field Name Description
harshAccelerationCount - Int
harshBrakeCount - Int
harshCorneringCount - Int
Example
{
  "harshAccelerationCount": 123,
  "harshBrakeCount": 987,
  "harshCorneringCount": 987
}

ElectricDetails

Fields
Field Name Description
drivingTime - Int
distanceCan - Float
distanceGps - Float
odometer - Float
consumption - EnergyConsumption
Example
{
  "drivingTime": 123,
  "distanceCan": 987.65,
  "distanceGps": 123.45,
  "odometer": 123.45,
  "consumption": EnergyConsumption
}

EnergyConsumption

Fields
Field Name Description
total - Float
average - Float
Example
{"total": 123.45, "average": 987.65}

FindAssignedJourneyFilter

Fields
Input Field Description
companyId - String!
depotId - String!
day - Date!
externalId - String!
Example
{
  "companyId": "abc123",
  "depotId": "abc123",
  "day": "2007-12-03",
  "externalId": "xyz789"
}

FindDailyVehicleTelemetryFilter

Fields
Input Field Description
companyId - String!
date - Date!
internalNumber - String
Example
{
  "companyId": "abc123",
  "date": "2007-12-03",
  "internalNumber": "xyz789"
}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
987.65

FloatMetric

Fields
Field Name Description
value - Float!
timestamp - DateTime!
Example
{
  "value": 123.45,
  "timestamp": "2007-12-03T10:15:30Z"
}

FuelConsumption

Fields
Field Name Description
total - Float
average - Float
driving - Float
idling - Float
Example
{"total": 123.45, "average": 123.45, "driving": 987.65, "idling": 123.45}

FuelDetails

Fields
Field Name Description
drivingTime - Int
idlingTime - Int
distanceCan - Float
distanceGps - Float
odometer - Float
consumption - FuelConsumption
Example
{
  "drivingTime": 123,
  "idlingTime": 123,
  "distanceCan": 123.45,
  "distanceGps": 123.45,
  "odometer": 987.65,
  "consumption": FuelConsumption
}

FuelType

Values
Enum Value Description

ELECTRIC

HVO

BIO_DIESEL

DIESEL

UNKNOWN

Example
"ELECTRIC"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

IntMetric

Fields
Field Name Description
value - Int!
timestamp - DateTime!
Example
{
  "value": 987,
  "timestamp": "2007-12-03T10:15:30Z"
}

JSON

Example
{}

JourneyInput

Fields
Input Field Description
vehicleNumber - String!
distance - Int!
line - String
startPoint - JourneyPointInput!
endPoint - JourneyPointInput!
externalId - String
Example
{
  "vehicleNumber": "abc123",
  "distance": 987,
  "line": "xyz789",
  "startPoint": JourneyPointInput,
  "endPoint": JourneyPointInput,
  "externalId": "abc123"
}

JourneyPoint

Fields
Field Name Description
name - String!
time - DateTime!
Example
{
  "name": "xyz789",
  "time": "2007-12-03T10:15:30Z"
}

JourneyPointInput

Fields
Input Field Description
name - String!
time - DateTime!
Example
{
  "name": "abc123",
  "time": "2007-12-03T10:15:30Z"
}

JourneyQueries

Fields
Field Name Description
searchJourneySummaries - JourneySummaryPage!
Arguments
Example
{"searchJourneySummaries": JourneySummaryPage}

JourneySort

Fields
Input Field Description
column - JourneySortColumns!
order - Order!
Example
{"column": "ID", "order": "ASCENDING"}

JourneySortColumns

Values
Enum Value Description

ID

Example
"ID"

JourneySummary

Description

A JourneySummary represents a single instance of driving activity performed by a Driver in a specific Vehicle within a Division.

Fields
Field Name Description
id - String!
divisionId - String
start - JourneySummaryPoint!
end - JourneySummaryPoint!
ecoDrive - EcoDriveSummary
details - JourneySummaryDetails!
vehicleInternalNumber - String!
driver - Driver
restriction - JourneySummaryRestriction
Example
{
  "id": "abc123",
  "divisionId": "abc123",
  "start": JourneySummaryPoint,
  "end": JourneySummaryPoint,
  "ecoDrive": EcoDriveSummary,
  "details": FuelDetails,
  "vehicleInternalNumber": "abc123",
  "driver": Driver,
  "restriction": "NONE"
}

JourneySummaryDetails

Types
Union Types

FuelDetails

ElectricDetails

Example
FuelDetails

JourneySummaryPage

Fields
Field Name Description
totalCount - Int!
items - [JourneySummary!]!
Example
{"totalCount": 123, "items": [JourneySummary]}

JourneySummaryPoint

Fields
Field Name Description
time - DateTime
latitude - String
longitude - String
Example
{
  "time": "2007-12-03T10:15:30Z",
  "latitude": "abc123",
  "longitude": "abc123"
}

JourneySummaryRestriction

Values
Enum Value Description

NONE

MINIMUM_DRIVE_TIME_NOT_MET

MINIMUM_DRIVING_DISTANCE_NOT_MET

MAXIMUM_AVERAGE_SPEED_EXCEEDED

CAN_FUEL_ABSENT_OR_BELOW_THRESHOLD

CAN_FUEL_NEGATIVE_OR_ABOVE_THRESHOLD

CAN_ODO_NEGATIVE

CAN_DATA_ABSENCE

OVERLAPPING_TRIP

Example
"NONE"

JourneyType

Values
Enum Value Description

SERVICE

DEAD_RUN

DEPOT_PARKING

Example
"SERVICE"

Order

Values
Enum Value Description

ASCENDING

DESCENDING

Example
"ASCENDING"

Organization

Fields
Field Name Description
companies - [Company!]!
Example
{"companies": [Company]}

OrganizationQueries

Fields
Field Name Description
getOrganization - Organization!
Example
{"getOrganization": Organization}

Pagination

Fields
Input Field Description
offset - Int
limit - Int
Example
{"offset": 123, "limit": 123}

ReassignJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
vehicleNumber - String!
timeFrom - DateTime!
timeTo - DateTime!
Example
{
  "companyId": "abc123",
  "depotId": "abc123",
  "blockId": "abc123",
  "day": "2007-12-03",
  "vehicleNumber": "xyz789",
  "timeFrom": "2007-12-03T10:15:30Z",
  "timeTo": "2007-12-03T10:15:30Z"
}

RegisterScheduledJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
journeys - [ScheduledJourneyInput!]!
Example
{
  "companyId": "abc123",
  "depotId": "abc123",
  "blockId": "xyz789",
  "day": "2007-12-03",
  "journeys": [ScheduledJourneyInput]
}

RemoveAssignedJourneyInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
line - String
vehicleNumber - String
startPointTime - DateTime!
endPointTime - DateTime!
Example
{
  "companyId": "xyz789",
  "depotId": "abc123",
  "blockId": "abc123",
  "day": "2007-12-03",
  "line": "abc123",
  "vehicleNumber": "abc123",
  "startPointTime": "2007-12-03T10:15:30Z",
  "endPointTime": "2007-12-03T10:15:30Z"
}

RemoveScheduledJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
from - DateTime!
to - DateTime!
Example
{
  "companyId": "xyz789",
  "depotId": "abc123",
  "blockId": "xyz789",
  "day": "2007-12-03",
  "from": "2007-12-03T10:15:30Z",
  "to": "2007-12-03T10:15:30Z"
}

RemoveScheduledJourneysResult

Fields
Field Name Description
removedJourneys - Int!
errors - [String!]
Example
{
  "removedJourneys": 123,
  "errors": ["abc123"]
}

RemoveVehicleJourneysInput

Fields
Input Field Description
companyId - String!
depotId - String!
blockId - String!
day - Date!
from - DateTime!
to - DateTime!
vehicleNumber - String
Example
{
  "companyId": "abc123",
  "depotId": "xyz789",
  "blockId": "xyz789",
  "day": "2007-12-03",
  "from": "2007-12-03T10:15:30Z",
  "to": "2007-12-03T10:15:30Z",
  "vehicleNumber": "xyz789"
}

RemoveVehicleJourneysResult

Fields
Field Name Description
removedJourneys - Int!
errors - [String!]
Example
{
  "removedJourneys": 987,
  "errors": ["xyz789"]
}

ScheduleMutations

Fields
Field Name Description
registerScheduledJourneys - [String!]!
removeScheduledJourneys - RemoveScheduledJourneysResult!
Arguments
assignVehicleJourneys - [String!]!
Arguments
removeVehicleJourneys - RemoveVehicleJourneysResult!
Arguments
assignJourneys - Boolean
Arguments
reassignJourneys - Int!
Arguments
removeAssignedJourney - Boolean
Arguments
Example
{
  "registerScheduledJourneys": ["xyz789"],
  "removeScheduledJourneys": RemoveScheduledJourneysResult,
  "assignVehicleJourneys": ["abc123"],
  "removeVehicleJourneys": RemoveVehicleJourneysResult,
  "assignJourneys": false,
  "reassignJourneys": 123,
  "removeAssignedJourney": true
}

ScheduleQueries

Fields
Field Name Description
searchScheduledJourneys - [ScheduledJourney!]!
Arguments
searchAssignedJourneys - [AssignedJourney!]!
Arguments
findAssignedJourney - AssignedJourney
Arguments
Example
{
  "searchScheduledJourneys": [ScheduledJourney],
  "searchAssignedJourneys": [AssignedJourney],
  "findAssignedJourney": AssignedJourney
}

ScheduledJourney

Fields
Field Name Description
depotId - String!
blockId - String!
day - DateTime!
distance - Int
line - String
startPoint - JourneyPoint!
endPoint - JourneyPoint!
points - [JourneyPoint!]
externalId - String
Example
{
  "depotId": "abc123",
  "blockId": "abc123",
  "day": "2007-12-03T10:15:30Z",
  "distance": 987,
  "line": "abc123",
  "startPoint": JourneyPoint,
  "endPoint": JourneyPoint,
  "points": [JourneyPoint],
  "externalId": "abc123"
}

ScheduledJourneyInput

Fields
Input Field Description
distance - Int!
line - String
startPoint - StopPointInput!
endPoint - StopPointInput!
externalId - String
Example
{
  "distance": 987,
  "line": "abc123",
  "startPoint": StopPointInput,
  "endPoint": StopPointInput,
  "externalId": "abc123"
}

SearchAssignedJourneysFilter

Fields
Input Field Description
companyId - String!
depotId - String!
day - Date!
vehicleNumber - String
blockId - String
Example
{
  "companyId": "xyz789",
  "depotId": "xyz789",
  "day": "2007-12-03",
  "vehicleNumber": "xyz789",
  "blockId": "abc123"
}

SearchJourneySummariesFilter

Fields
Input Field Description
companyId - String!
divisionId - String
day - Date!
Example
{
  "companyId": "abc123",
  "divisionId": "abc123",
  "day": "2007-12-03"
}

SearchScheduledJourneysFilter

Fields
Input Field Description
companyId - String!
depotId - String!
day - Date!
blockId - String!
externalId - String
Example
{
  "companyId": "abc123",
  "depotId": "xyz789",
  "day": "2007-12-03",
  "blockId": "abc123",
  "externalId": "xyz789"
}

SearchVehiclesFilter

Fields
Input Field Description
companyId - String!
internalNumber - String
divisionId - String
fuelType - FuelType
vin - String
bmsId - String
deleted - Boolean
Example
{
  "companyId": "xyz789",
  "internalNumber": "xyz789",
  "divisionId": "xyz789",
  "fuelType": "ELECTRIC",
  "vin": "abc123",
  "bmsId": "abc123",
  "deleted": true
}

StopPointInput

Fields
Input Field Description
name - String!
time - DateTime!
id - String
latitude - Float
longitude - Float
Example
{
  "name": "xyz789",
  "time": "2007-12-03T10:15:30Z",
  "id": "xyz789",
  "latitude": 123.45,
  "longitude": 987.65
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"xyz789"

TelemetryQueries

Fields
Field Name Description
findDailyVehicleTelemetry - [DailyVehicleTelemetry!]!
Example
{"findDailyVehicleTelemetry": [DailyVehicleTelemetry]}

UpdateVehicleInput

Fields
Input Field Description
companyId - String!
vehicleId - String!
vehicleMetadata - VehicleMetadata!
Example
{
  "companyId": "abc123",
  "vehicleId": "xyz789",
  "vehicleMetadata": VehicleMetadata
}

Vehicle

Fields
Field Name Description
id - String
companyId - String
internalNumber - String
divisionId - String
fuelType - FuelType
bmsId - String
vin - String
model - String
make - String
vehicleType - String
devices - [VehicleDevice!]
batteryKwh - Float
consumptionPerKm - Float
deleted - Boolean
svv - JSON
Example
{
  "id": "abc123",
  "companyId": "abc123",
  "internalNumber": "xyz789",
  "divisionId": "xyz789",
  "fuelType": "ELECTRIC",
  "bmsId": "xyz789",
  "vin": "xyz789",
  "model": "xyz789",
  "make": "abc123",
  "vehicleType": "abc123",
  "devices": [VehicleDevice],
  "batteryKwh": 987.65,
  "consumptionPerKm": 987.65,
  "deleted": false,
  "svv": {}
}

VehicleAssignment

Fields
Input Field Description
vehicleNumber - String!
from - DateTime!
to - DateTime!
registeredAt - DateTime!
Example
{
  "vehicleNumber": "xyz789",
  "from": "2007-12-03T10:15:30Z",
  "to": "2007-12-03T10:15:30Z",
  "registeredAt": "2007-12-03T10:15:30Z"
}

VehicleDevice

Fields
Field Name Description
deviceId - String!
deviceType - String!
Example
{
  "deviceId": "xyz789",
  "deviceType": "xyz789"
}

VehicleId

Fields
Field Name Description
companyId - String!
internalNumber - String!
Example
{
  "companyId": "abc123",
  "internalNumber": "xyz789"
}

VehicleMetadata

Fields
Input Field Description
internalNumber - String
fuelType - FuelType
divisionId - String
bmsId - String
vin - String
model - String
make - String
batteryKwh - Float
consumptionPerKm - Float
registrationNumber - String
vehicleType - String
deleted - Boolean
Example
{
  "internalNumber": "xyz789",
  "fuelType": "ELECTRIC",
  "divisionId": "xyz789",
  "bmsId": "abc123",
  "vin": "xyz789",
  "model": "xyz789",
  "make": "xyz789",
  "batteryKwh": 987.65,
  "consumptionPerKm": 123.45,
  "registrationNumber": "xyz789",
  "vehicleType": "xyz789",
  "deleted": true
}

VehicleMutations

Fields
Field Name Description
createVehicle - VehicleResult!
Arguments
updateVehicle - VehicleResult!
Arguments
Example
{
  "createVehicle": VehicleResult,
  "updateVehicle": VehicleResult
}

VehicleQueries

Fields
Field Name Description
searchVehicles - [Vehicle!]!
Arguments
Example
{"searchVehicles": [Vehicle]}

VehicleResult

Fields
Field Name Description
message - String
id - String
Example
{
  "message": "xyz789",
  "id": "xyz789"
}