DVLA Data Connector

The DVLA Data Connector provides access to the DVLA Vehicle Enquiry API. This Data Connector can be used to query vehicle registration numbers.

Constructor

DVLA(key) → {object}

We recommend that you create a Data Connector Configuration called "DVLA" via the Verj.io Runtime Environment's Administration Application.

A DVLA Data Connector is then available at connectors.verjio.dvla using that configuration.

If you are unable to do that, you may use this constructor to create a new DVLA Data Connector.

This constructor accepts an API key.

Parameters:
Name Type Description
key string

DVLA API key.

Returns:
object

The DVLA Data Connector.

Functions

getVehicleInfo(registrationNumber) → (nullable) {DVLA.VehicleInformation}

Retrieves vehicle information from the DVLA.

Parameters:
Name Type Description
registrationNumber string

Vehicle registration number (VRN).

Returns:
DVLA.VehicleInformation

API response object containing vehicle information, or null if an error was encountered.

Example:
// Get the vehicle make and colour
try {
	var info = connectors.verjio.dvla.getVehicleInfo(fields.vehicleRegistrationNumber.value);
	fields.vehicleMake.value = info.make;
	fields.vehicleColour.value = info.colour;
}
catch (e) {
	if (e instanceof connectors.errors.NotFoundError) {
		event.owner.addErrorMessage('The vehicle registration number you entered was not found.');
	}
}

handleError(response)

Checks an API response for errors. If an error is encountered, the appropriate Error is thrown.

Parameters:
Name Type Description
response object

The response from a services.rest request.

Throws:
  • AuthorisationError
  • NotFoundError
  • ServerError
  • RequestError

Type definitions

VehicleInformation

Vehicle information as returned by the DVLA API.

Properties:
Name Type Description
registrationNumber string

Vehicle registration number (VRN)

taxStatus string

Vehicle tax status, e.g. Taxed.

taxDueDate string

Date the vehicle tax is due. Formated as YYYY-MM-dd.

motStatus string

Vehicle MOT status, e.g. Valid.

make string

Vehicle manufacturer, e.g. FORD.

yearOfManufacture number

Year of manufacture.

engineCapacity number

Engine capacity in cubic centimeters (cc).

co2Emissions number

Carbon dioxide emissions in grams per kilometer (g/km)

fuelType string

Fuel type, e.g. PETROL.

markedForExport boolean

Has the vehicle been marked for export?

colour string

Bodywork colour, e.g. SILVER.

typeApproval string

Vehicle type approval. See Type Approval Categories.

dateOfLastV5CIssued string

Date of the last vehicle log book (V5C) issue. Formated as YYYY-MM-dd.

motExpiryDate string

Date the vehicle MOT expires. Formated as YYYY-MM-dd.

wheelplan string

Details of vehicle axles.

monthOfFirstRegistration string

Date of the vehicle registration. Formated as YYYY-MM.

Copyright Ebase Technology 2024