Download the PHP package lendable/dvla-vehicle-enquiry-api-client without Composer

On this page you can find all versions of the php package lendable/dvla-vehicle-enquiry-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dvla-vehicle-enquiry-api-client

DVLA Vehicle Enquiry API client

Latest Stable Version License

PHP client implementation for the DVLA Vehicle Enquiry API v1. This package provides:

Installation

You can install the library via Composer.

Usage

The Client class implements the DVLA's REST API and can return the vehicles scope which can be used to request the vehicle details.

For the instantiation of the Client class we need to inject the decorators which adds the API key authentication, and the PSR-18 compatibility layers. Also, we need to define the API's base URI to easily switch between UAT and live service.

Base URI

The API's specification contains the UAT and live URL. The given URI should not end with slash (/) and should contain the /v1 path too.

For example: https://uat.driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1

The client accepts the URI in any PSR-7 UriInterface implementation.

Authentication

The ApiKeyAuthHttpClientDecorator adds the required API token authentication headers to the requests. The ApiKey value object keeps the token secret, avoiding accidental exposure.

HTTP client

With the Psr18ClientDecorator you can use any HTTP client which supports the PSR-18 standard to perform the prebuilt HTTP request.

If you prefer to use an HTTP client that doesn't support the PSR-18 standard, you can alternatively make a simple decorator that calls the HTTP client using the PSR-18 RequestInterface format request data and convert the HTTP client's response to a PSR-18 ResponseInterface format response.

For example in our integration test we are using GuzzleClient with a decorator which using this PSR-18 conversion.

Example request

This makes an API request with the AA19PPP registration number and the $vehicleDetails variable will contain an EnquiryResponse object which contains all the returned API response data in value objects.

This example is using the UAT API URL and a test registration number. Test registration numbers for mock responses of the different test cases are available in the DVLA Vehicle Enquiry Service API documentation.


All versions of dvla-vehicle-enquiry-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
ext-json Version *
beberlei/assert Version ^3.2
nyholm/psr7 Version ^1.2
paragonie/hidden-string Version ^1.0 || ^2.0
psr/http-client Version ^1.0.1
psr/http-message Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lendable/dvla-vehicle-enquiry-api-client contains the following files

Loading the files please wait ....