forked from nixilla/carweb-api-consumer
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.php
More file actions
25 lines (20 loc) · 688 Bytes
/
Copy pathexample.php
File metadata and controls
25 lines (20 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
use Carweb\Cache\TempFileCache;
require_once './vendor/autoload.php';
$strUserName = 'your user name';
$strPassword = 'your password';
$strKey1 = 'your key';
$vrm = 'VRM - Vehicle Registration Mark to be checked';
$vin = 'VIN - Vehicle Identification Number to be checked';
$client = new Buzz\Browser(new Buzz\Client\Curl());
$consumer = new Carweb\Consumer($client, $strUserName, $strPassword, $strKey1, new TempFileCache());
try
{
$xmlstring1 = $consumer->findByVRM($vrm);
$xmlstring2 = $consumer->findByVIN($vin);
$xmlstring3 = $consumer->findByVRM($vin); // throws exception
}
catch (\Carweb\Exception\ApiException $e)
{
printf("%s\n", $e->getMessage());
}