# Create sensor

Create a new sensor

Endpoint: POST /sensor
Version: 0.9.74
Security: bearer, apiKey, apiSecret

## Header parameters:

  - `Authorization` (string, required)

## Request fields (application/json):

  - `nonce` (string)

  - `name` (string)

  - `identifiers` (array)

  - `identifiers.nonce` (string)
    Nonce, a field that is not saved and returns exactly the same value you sent. This ensures you can identify your object that has been updated or created.

  - `identifiers.uuid` (string, required)

  - `identifiers.primaryPlatformId` (string, required)

  - `identifiers.language` (object)
    circular reference

  - `identifiers.name` (string)

  - `identifiers.system` (string)

  - `identifiers.value` (string)

  - `identifiers.expiredAt` (string)

  - `externalAttributes` (object)

  - `placement` (string)
    Sometimes more than one sensor can be associated with a single entity. This is the case e.g. in cooled trailers that are divided into compartments with different temperatures, where each compartment has its own sensor. The placement member can be used to identify where a sensor is placed. Parties using OpenTripModel to exchange sensor data may wish to agree on a standardized naming, but this is too specific to describe in the standard.

  - `type` (string)
    Type of the sensor, e.g. temperature, speed, etc.
    Example: "temperature"

  - `constraints` (array)

  - `constraints.nonce` (string)
    Nonce, a field that is not saved and returns exactly the same value you sent. This ensures you can identify your object that has been updated or created.

  - `constraints.uuid` (string, required)

  - `constraints.primaryPlatformId` (string, required)

  - `constraints.language` (object)
    circular reference

  - `constraints.type` (string)
    Enum: "accessConstraint", "timeConstraint", "timeWindowsConstraint", "startDateTimeConstraint", "endDateTimeConstraint", "sizeConstraint", "weightConstraint", "speedConstraint", "sensorValueConstraint", "fuelTypeConstraint", "vehicleTypeConstraint", "emissionStandardConstraint", "attributeConstraint", "transportEquipmentTypeConstraint", "routeConstraint", "andConstraint", "orConstraint", "notConstraint", "genericConstraint"

  - `constraints.name` (string)

  - `constraints.enforceability` (string)
    Enum: "enforced", "preference"

  - `lastValueEvent` (object)

  - `lastValueEvent.nonce` (string)
    Nonce, a field that is not saved and returns exactly the same value you sent. This ensures you can identify your object that has been updated or created.

  - `lastValueEvent.uuid` (string, required)

  - `lastValueEvent.primaryPlatformId` (string, required)

  - `lastValueEvent.language` (object)
    circular reference

  - `lastValueEvent.type` (string)
    Enum: "generalEvent", "sensorUpdateEvent", "gateInEvent", "gateOutEvent", "arrivalEvent", "departureEvent", "stopEngineEvent", "startEngineEvent", "startWaitingEvent", "stopWaitingEvent", "stopMovingEvent", "startMovingEvent", "locationUpdateEvent", "updateEvent", "associationRemovedEvent", "associationCreatedEvent", "capacityChangeEvent"

  - `lastValueEvent.lifeCycle` (string)
    Enum: "requested", "planned", "projected", "actual", "realized"

  - `lastValueEvent.externalAttributes` (object)

  - `lastValueEvent.identifiers` (array)

  - `lastValueEvent.dateTime` (string)

  - `lastValueEvent.sensor` (object)
    circular reference

  - `lastValueEvent.value` (object, required)

  - `lastValueEvent.value.value` (string)

  - `lastValueEvent.value.unit` (string)

## Response 200 fields (application/json):

  - `success` (boolean)

  - `message` (string)

  - `code` (integer)

  - `sensor` (object)

  - `sensor.id` (string, required)
    Uniquely identifies this entity. A ID can be assigned  or will be generated by the server if the request doesn't provide it. Once assigned, the ID can't be changed

  - `sensor.nonce` (string)
    Nonce, a field that is not saved and returns exactly the same value you sent. This ensures you can identify your object that has been updated or created.

  - `sensor.uuid` (string, required)

  - `sensor.primaryPlatformId` (string, required)

  - `sensor.createdAt` (string)
    The date and time this Entity has been created

  - `sensor.updatedAt` (string)
    The date and time this Entity has been updated

  - `sensor.language` (object)
    circular reference

  - `sensor.platforms` (array)

  - `sensor.name` (string)

  - `sensor.identifiers` (array)

  - `sensor.externalAttributes` (object)

  - `sensor.placement` (string)
    Sometimes more than one sensor can be associated with a single entity. This is the case e.g. in cooled trailers that are divided into compartments with different temperatures, where each compartment has its own sensor. The placement member can be used to identify where a sensor is placed. Parties using OpenTripModel to exchange sensor data may wish to agree on a standardized naming, but this is too specific to describe in the standard.

  - `sensor.type` (string)
    Type of the sensor, e.g. temperature, speed, etc.
    Example: "temperature"

  - `sensor.constraints` (array)

  - `sensor.lastValueEvent` (object)

## Response 400 fields (application/json):

  - `success` (boolean)

  - `message` (string)

  - `code` (integer)

  - `errors` (array)

  - `suggestion` (string)


