Vehicle Attributes

The Attributes are the specifications that determine the tasks a Vehicle can perform. The following Attributes are unique to defining a transportation medium:

Attribute

Description

Data type

vehicleName

The name of the participant Vehicle.
Character length: Min- 1 & Max- 64

string

vehicleCode

The participant ID of the participant type as specified in allowedOwners during the creation of the said type.
Character length: Min- 1 & Max- 64

string

vehicleCategory

Category of the Vehicle. Default: Truck, 2W, Car.

string

vehicleSubCategory

Sub-category of the Vehicle. Default: 2W - Motorcycle/Scooter/E-bike, Van, Truck - 19 ft/24 ft/32 ft

string

vehicleMode

The mode of the Vehicle.
Default: Land, Air, Sea -- derived from Vehicle category.

string

fuelType

The fuel type of the Vehicle.
Default: Petrol/Gasoline, Diesel, Electric, CNG, Manual/Hand-powered -- derived from Vehicle category.

string

vehicleStructure

The structure of the Vehicle.
Default: Single-unit, Multi-unit/Tractor, Multi-unit/Trailer– derived from Vehicle category.

string

cargoArea (optional)

Cargo area of the Vehicle.

number

payloadCapacity (optional)

Payload capacity of the Vehicle.

number

regnNo (optional)

Registration number of the Vehicle.

string

regnYear (optional)

Registration year of the Vehicle.

number

availability (optional)

The availability of the Vehicle according to days, dates, time, etc.

object

vehicleOwnership (optional)

The owner of the Vehicle among self, seller, and partner.

string

operatorId

Operator ID of the Vehicle.

string

ownerDetails (optional)

Details of the Vehicle owner if the Vehicle is sourced via an intermediary like a broker.

object

serviceability (optional)

Geographic area of service (cities, pincodes, map polygons)

object

reportingCenter (optional)

Reporting Center of the Vehicle (participant ID of reporting facility).

string

Creating Custom Attributes

You can use the Participant Management API to create custom attributes for the Vehicles. To create a Custom Attribute, call the POST /{resourceName}/attributes endpoint and pass the following parameters in the request body:

Member

Description

Remarks

name

Name of the attribute to be created.

Data type: string
minLength: 1 maxLength: 32
pattern: It should match a through z or A through Z, inclusive (range)

description (optional)

Description of the attribute.

Data type: string
minLength: 0 maxLength: 256

dataType

Data type of the attribute.

Data type: string

defaultValue (optional)

The default value of the attribute.

Data type: string/boolean/int

validation: range

Minimum and maximum values if the data type is a number or string.

Data type: object

validation: regex

Regex pattern that the string type data should match.

Data type: string
minLength: 1 maxLength: 512

validation: valueOneOf (optional)

Enum of accepted values.

Data type: Enum
minItems: 1

validation: required (optional)

Specifies whether the value is required or optional.

Data type: boolean
default: false

mapping (optional)

Mapping with the participant service.

Data type: string

vaultName (optional)

Name of the vault for PII sensitive data.

Data type: string

piiSensitive (optional)

Define if the attribute is PII-sensitive data.

Data type: boolean
default: false

The following example request body shows how to create and update a Custom Attribute named Operating Hours:

{
  "name": "Operating Hours",
  "description": "Operational hours of a vehicle",
  "dataType": "boolean",
  "indexed": false,
  "defaultValue": true,
  "validation": {
    "range": {
      "min": 0,
      "max": 1000
    },
    "regex": "/^(0?[1-9]|1[0-2]):[0-5][0-9]$/",
    "valueOneOf": [
      [
        "5",
        "7",
      ]
    ],
    "required": false
  },
  "mapping": "properties",
  "vaultName": "vault01",
  "piiSensitive": true,
  ]
}
{
  "name": "Operating Hours",
  "description": "Operational hours of a Vehicle",
  "dataType": "boolean",
  "indexed": false,
  "defaultValue": true,
  "validation": {
    "range": {
      "min": 0,
      "max": 1000
    },
    "regex": "/^(0?[1-9]|1[0-2]):[0-5][0-9]$/",
    "valueOneOf": [
      [
        "5",
        "7",
        "10",
      ]
    ],
    "required": false
  },
  "mapping": "properties",
  "vaultName": "vault01",
  "piiSensitive": true,
  ]
}

Did this page help you?