Skip to content

Adds a new Vehicle

Request

Security
BearerToken
Bodyapplication/json
idstring

Uniquely identifies this entity. A URI can be assigned by the client to indicate where more information can be retrieved. Note that every entity always has a unique EntityId. However since, OTM5.2 it is not required to send it in the request. One can be generated for you by the server.

Example:"b9bb914d-845e-46f2-91ff-31fa4bac2fbe"
namestring

Name of the entity. For display purposes and search only.

Example:"Bob's Boxtruck"
creationDatestring

The creation date of this entity.

lastModifiedstring

The last modified date of this entity. If none is given the creation date is used instead.

contextEventsArray of any(events)

The context events provides some optional information about the events that can provide additional information on the current state of this entity.

For example: your system might send ETA information for the arrival of a vehicle on a location. To make it clear what caused this ETA to be updated, we can include some information about what caused this ETA update by including an event as context. If your ETA update was caused by a location update, this event can be included as context. If the ETA was caused by a traffic accident on the route of the vehicle, you can include that event in the context.

externalAttributesobject
vehicleTypestring

The type of vehicle

Example:"boxtruck"
fuelstring

The type of fuel the vehicle runs on. For vehicle without an engine of their own, such as a trailer, you may choose not-applicable. For trailers with cooling capabilities, choose the fuel type of the cooling engine.

Enum:"petrol""diesel""electricity""hydrogen""lng""cng""adBlue""other"
Example:"electricity"
otherFuelTypestring

Type of fuel, only to be used when the fuel field is set to other.

averageFuelConsumptionobject

The average fuel consumption for this vehicle. Usually measured in distance per 100l

emissionStandardstring

European emission standards are vehicle emission standards for exhaust emissions of new vehicles sold in the European Union and EEA member states. The standards are defined in a series of European Union directives staging the progressive introduction of increasingly stringent standards. See also European emission standards - Wikipedia.

Enum:"euro0""euro1""euro2""euro3""euro4""euro5""euro6"
loadCapacitiesArray of objects

The load capacities of the Vehicle. This can be an array of values, for several reasons:

  • The Vehicle might be split up in multiple compartments.
  • You might want to express the load capacities in different quantities. E.g. in square meters or litres as well as in number of pallets.
Example:
[ { "value": 1000, "unit": "kg" } ]
lengthobject

The length of the Vehicle.

Example:
{ "value": 8, "unit": "m" }
heightobject

The height of the Vehicle.

Example:
{ "value": 2.8, "unit": "m" }
widthobject

The width of the Vehicle.

Example:
{ "value": 2, "unit": "m" }
licensePlatestring

The license plate of the vehicle.

Example:"AB-12-CD"
emptyWeightobject

The weight of the Vehicle when empty.

Example:
{ "value": 2000, "unit": "kg" }
actorsArray of any

There are multiple roles in which actors can be associated with a vehicle, such as the owner or the driver of the vehicle.

sensorsArray of any

Vehicles might have some sensors that are permanently attached, these can be described using the sensors field. If one works with detachable sensors the recommend approach is to use associationCreated and associationRemoved events instead.

actionsArray of any(associations-actions)

The actions that are involved for the vehicle (for a particular time window)

curl -i -X PUT \
  https://otm-api-spec.redocly.app/_mock/api/5.7/otm/api/v5/vehicles \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "b9bb914d-845e-46f2-91ff-31fa4bac2fbe",
    "name": "Bob'\''s Boxtruck",
    "vehicleType": "boxtruck",
    "fuel": "electricity",
    "loadCapacities": [
      {
        "value": 1000,
        "unit": "kg"
      }
    ],
    "length": {
      "value": 8,
      "unit": "m"
    },
    "height": {
      "value": 2.8,
      "unit": "m"
    },
    "width": {
      "value": 2,
      "unit": "m"
    },
    "licensePlate": "AB-12-CD",
    "emptyWeight": {
      "value": 2000,
      "unit": "kg"
    }
  }'

Responses

The same entity

Bodyapplication/json
idstring

Uniquely identifies this entity. A URI can be assigned by the client to indicate where more information can be retrieved. Note that every entity always has a unique EntityId. However since, OTM5.2 it is not required to send it in the request. One can be generated for you by the server.

Example:"b9bb914d-845e-46f2-91ff-31fa4bac2fbe"
namestring

Name of the entity. For display purposes and search only.

Example:"Bob's Boxtruck"
creationDatestring

The creation date of this entity.

lastModifiedstring

The last modified date of this entity. If none is given the creation date is used instead.

contextEventsArray of any(events)

The context events provides some optional information about the events that can provide additional information on the current state of this entity.

For example: your system might send ETA information for the arrival of a vehicle on a location. To make it clear what caused this ETA to be updated, we can include some information about what caused this ETA update by including an event as context. If your ETA update was caused by a location update, this event can be included as context. If the ETA was caused by a traffic accident on the route of the vehicle, you can include that event in the context.

externalAttributesobject
vehicleTypestring

The type of vehicle

Example:"boxtruck"
fuelstring

The type of fuel the vehicle runs on. For vehicle without an engine of their own, such as a trailer, you may choose not-applicable. For trailers with cooling capabilities, choose the fuel type of the cooling engine.

Enum:"petrol""diesel""electricity""hydrogen""lng""cng""adBlue""other"
Example:"electricity"
otherFuelTypestring

Type of fuel, only to be used when the fuel field is set to other.

averageFuelConsumptionobject

The average fuel consumption for this vehicle. Usually measured in distance per 100l

emissionStandardstring

European emission standards are vehicle emission standards for exhaust emissions of new vehicles sold in the European Union and EEA member states. The standards are defined in a series of European Union directives staging the progressive introduction of increasingly stringent standards. See also European emission standards - Wikipedia.

Enum:"euro0""euro1""euro2""euro3""euro4""euro5""euro6"
loadCapacitiesArray of objects

The load capacities of the Vehicle. This can be an array of values, for several reasons:

  • The Vehicle might be split up in multiple compartments.
  • You might want to express the load capacities in different quantities. E.g. in square meters or litres as well as in number of pallets.
Example:
[ { "value": 1000, "unit": "kg" } ]
lengthobject

The length of the Vehicle.

Example:
{ "value": 8, "unit": "m" }
heightobject

The height of the Vehicle.

Example:
{ "value": 2.8, "unit": "m" }
widthobject

The width of the Vehicle.

Example:
{ "value": 2, "unit": "m" }
licensePlatestring

The license plate of the vehicle.

Example:"AB-12-CD"
emptyWeightobject

The weight of the Vehicle when empty.

Example:
{ "value": 2000, "unit": "kg" }
actorsArray of any

There are multiple roles in which actors can be associated with a vehicle, such as the owner or the driver of the vehicle.

sensorsArray of any

Vehicles might have some sensors that are permanently attached, these can be described using the sensors field. If one works with detachable sensors the recommend approach is to use associationCreated and associationRemoved events instead.

actionsArray of any(associations-actions)

The actions that are involved for the vehicle (for a particular time window)

Response
{ "id": "b9bb914d-845e-46f2-91ff-31fa4bac2fbe", "name": "Bob's Boxtruck", "vehicleType": "boxtruck", "fuel": "electricity", "loadCapacities": [ { … } ], "length": { "value": 8, "unit": "m" }, "height": { "value": 2.8, "unit": "m" }, "width": { "value": 2, "unit": "m" }, "licensePlate": "AB-12-CD", "emptyWeight": { "value": 2000, "unit": "kg" } }