computerminds/ecoes-api

API client for the ECOES API.

0.3.0 2023-10-24 10:10 UTC

This package is auto-updated.

Last update: 2024-10-24 12:14:23 UTC


README

This library provides an API client for communicating with the ECOES API.

It uses Guzzle as a the underlying HTTP client.

Making requests

SearchUtilityAddress

$ecoes = new Ecoes\Api('API KEY GOES HERE');
$request = new Ecoes\SearchUtilityAddress\Request('POSTCODE');
// $matches will be an array of matching addresses.
$matches = $ecoes->SearchUtilityAddress($request)->getUtilityAddressMatches();

GetTechnicalDetailsByMpan

$ecoes = new Ecoes\Api('API KEY GOES HERE');
$request = new Ecoes\GetTechnicalDetailsByMpan\Request('MPAN');
// $matches will be an array of matching MPANs.
$matches = $ecoes->GetTechnicalDetailsByMpan($request)->getUtilityMatches();
// $match will be an array of a single matched MPAN.
$match = $ecoes->GetTechnicalDetailsByMpan($request)->getUtilityMatch();