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 {
    searchAssignedJourneys {
      depotId
      blockId
      day
      registeredAt
      vehicleNumber
      distance
      line
      startPoint {
        ...JourneyPointFragment
      }
      endPoint {
        ...JourneyPointFragment
      }
      points {
        ...JourneyPointFragment
      }
      type
    }
  }
}
Response
{
  "data": {
    "schedule": {
      "searchAssignedJourneys": [AssignedJourney]
    }
  }
}

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 {
    assignJourneys
    removeAssignedJourney
  }
}
Response
{"data": {"schedule": {"assignJourneys": true, "removeAssignedJourney": true}}}

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": "abc123",
  "depotId": "xyz789",
  "blockId": "abc123",
  "day": "2007-12-03",
  "journeys": [JourneyInput]
}

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!
Example
{
  "depotId": "abc123",
  "blockId": "xyz789",
  "day": "2007-12-03T10:15:30Z",
  "registeredAt": "2007-12-03T10:15:30Z",
  "vehicleNumber": "xyz789",
  "distance": 123,
  "line": "abc123",
  "startPoint": JourneyPoint,
  "endPoint": JourneyPoint,
  "points": [JourneyPoint],
  "type": "SERVICE"
}

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
}

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": true
}

Division

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

Driver

Fields
Field Name Description
id - String!
name - String
team - String
Example
{
  "id": "abc123",
  "name": "abc123",
  "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": 987,
  "distanceCan": 987.65,
  "distanceGps": 987.65,
  "odometer": 987.65,
  "consumption": EnergyConsumption
}

EnergyConsumption

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

Float

Description

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

Example
987.65

FuelConsumption

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

FuelDetails

Fields
Field Name Description
drivingTime - Int
idlingTime - Int
distanceCan - Float
distanceGps - Float
odometer - Float
consumption - FuelConsumption
Example
{
  "drivingTime": 987,
  "idlingTime": 987,
  "distanceCan": 987.65,
  "distanceGps": 123.45,
  "odometer": 123.45,
  "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
987

JSON

Example
{}

JourneyInput

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

JourneyPoint

Fields
Field Name Description
name - String!
time - DateTime!
Example
{
  "name": "abc123",
  "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": "xyz789",
  "driver": Driver,
  "restriction": "NONE"
}

JourneySummaryDetails

Types
Union Types

FuelDetails

ElectricDetails

Example
FuelDetails

JourneySummaryPage

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

JourneySummaryPoint

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

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": 987, "limit": 123}

RemoveAssignedJourneyInput

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

ScheduleMutations

Fields
Field Name Description
assignJourneys - Boolean
Arguments
removeAssignedJourney - Boolean
Arguments
Example
{"assignJourneys": true, "removeAssignedJourney": true}

ScheduleQueries

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

SearchAssignedJourneysFilter

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

SearchJourneySummariesFilter

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

SearchVehiclesFilter

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

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"

UpdateVehicleInput

Fields
Input Field Description
companyId - String!
vehicleId - String!
vehicleMetadata - VehicleMetadata!
Example
{
  "companyId": "xyz789",
  "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": "xyz789",
  "companyId": "xyz789",
  "internalNumber": "xyz789",
  "divisionId": "xyz789",
  "fuelType": "ELECTRIC",
  "bmsId": "abc123",
  "vin": "xyz789",
  "model": "xyz789",
  "make": "abc123",
  "vehicleType": "xyz789",
  "devices": [VehicleDevice],
  "batteryKwh": 987.65,
  "consumptionPerKm": 123.45,
  "deleted": false,
  "svv": {}
}

VehicleDevice

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

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": "abc123",
  "fuelType": "ELECTRIC",
  "divisionId": "xyz789",
  "bmsId": "abc123",
  "vin": "xyz789",
  "model": "abc123",
  "make": "abc123",
  "batteryKwh": 987.65,
  "consumptionPerKm": 123.45,
  "registrationNumber": "xyz789",
  "vehicleType": "abc123",
  "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": "abc123",
  "id": "abc123"
}