DriveSmart APIs: Diesel Van Selector



About Our Diesel Van Selector

This API selects only diesel vans. The diesel van selector is used to choose only current vans (i.e. currently for sale as new) with a diesel engine.

Modules

The selector can be used with other API modules for selecting van running cost and finance comparisons.

Selectors for other types of vans can be see at the following links:

Dataset:

The dataset can be provided in 'JSON' or 'XML' format.

For the manufacturer, model and derivative the datasets are presented as one single column with a column name (see below).

For the CAPID the dataset is presented as four columns, one each representing the manufacturer, model, derivative and the resulting CAPID to verify the data sent to the API.

You can choose the type of data returned in your HTTPS request by declaring 'json' or 'xml' in the 'd_Type' element of the request string.

JSON is the default type for the dataset if no 'd_Type' is set.

Our Demo

Our demonstrator provides an illustration of how the API delivers a list of only current Diesel engine vans.

We provide examples of the related HTTPS {GET}/{POST} requests for each stage of (other than those already illustrated on other API pages).

You can copy and paste the sample request strings into a browser address bar to see the raw XML data returned for the request (right click on the browser page displayed and you will see the XML dataset).

You can also substitute XML for JSON when you perform the 'copy|paste' exercise.

For each of the manufacturer, model and derivative lists below we have presented list with:

'Choose a [manufacturer/model/derivative] ...'

inserted into the list as the first item.

This is simply to force the user to make a selection other than the first named item in the list.

{GET} Requirements

The {GET} request follows standard HTTPS key:value pair protocols. No response will be given for an HTTP request.

The {GET} request requires our standard security login/session token.

Our example obtains a valid CAPID for a Diesel engine van - if you use your own method of selecting a vehicle then, to use any other APIs, you must provide a CAPID for a vehicle currently for sale new in the UK - a CAPID for a discontinued model or retired derivative will not return a dataset.

Data Retrieval

Once you have selected a manufacturer, model and derivative you will see the API {GET} requests in the respective text boxes below.

You will also see the {GET} request string as an example and the returned dataset structured as a typical online representation of XML for the van.

This will include the dataset XML node descriptions so that you can see the schema.

Security

A session token is created on initial login and must be included as a cookie with all HTTPS requests or the request will fail.

If the user's browser does not allow functional cookies then the {GET} request will become orphaned and the request cannot be linked to any other requests in the same session.

If the session token is not included then the session will be terminated, any data created in the session may be erased at the server and the user may need to re-authenticate with a new session.

For security reasons the HTTPS protocol must be used for all {GET} requests so that all data passed between the browser and the server is encrypted, including the session token.

Pair:Value Summary

Details of the API URL string components are as follows:

All
d_type: xml or json for the required return data type (json if not specified)

Vehicle

Details of the requests for creating a Diesel vehicle are as set out below.

Other
v_mfr: a string type variable for the manufacturer name
v_mod: a string type variable for the model name
v_der: a string type variable for the derivative name

When the manufacturer, model and derivative are selected the CAPID code (an integer) will be presented as part of the dataset (along with the manufacturer, model and derivative names) as verification of the data sent in the {GET} request.

Worked example of both API requests are included below.



 



Select a Manufacturer

When you select a manufacturer you will then see the model range list updated

Manufacturer


Example HTTPS Request String To Fetch Manufacturer List {Get:}


DataSet Provided

MANUFACTURER
CITROEN
DACIA
FIAT
FORD
INEOS
ISUZU
ISUZU TRUCK
IVECO
KGM
LAND ROVER
MAN
MAXUS
MERCEDES-BENZ
NISSAN
PEUGEOT
RENAULT
RENAULT TRUCKS UK
TOYOTA
VAUXHALL
VOLKSWAGEN