1. Go to this page and download the library: Download jdkweb/rdw-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jdkweb / rdw-api example snippets
use Jdkweb\RdwApi\Controllers\RdwApiRequest;
...
$result = (object) RdwApiRequest::make()
->setLicenseplate('AB-895-P')
->fetch();
use Jdkweb\RdwApi\Controllers\RdwApiRequest;
use Jdkweb\RdwApi\Enums\OutputFormats;
use Jdkweb\RdwApi\Enums\Endpoints;
...
$result = RdwApiRequest::make()
->setAPI(0)
->setLicenseplate('AB-895-P')
->setEndpoints(Endpoints::cases())
->setOutputformat(OutputFormats::JSON)
->setLanguage('en')
->fetch(true);
use \Jdkweb\RdwApi\Enums\Endpoints;
...
->setEndpoints(array)
# examples:
// Call to all endpoints
->setEndpoints(Endpoints::cases())
// Specific selection
->setEndpoints([
Endpoints::VEHICLE,
Endpoints::FUEL
])
// Use enum names, case insensitive
->setEndpoints([
'vehicle',
'fuel'
])
use \Jdkweb\RdwApi\Enums\OutputFormats;
...
->setOuputformat(string|OutputFormat)
# examples
// Enum
->setOuputformat(OutputFormats::JSON)
// name, case insensitive
->setOuputformat('json')
->setLanguage(string)
->fetch(?bool $return = null)
Jdkweb\RdwApi\Controllers\RdwApiResponse {#2800 ▼
+response: array:2 [▶] // API response
+request: {#3036 ▶} // Request vars
+output: array:2 [▶] // Formated output when setOutputFormat is used
+status: true
}
$result->toArray()
$result->toJson()
$result->toXml(bool $pretty)
$result->toObject()
$result->quickSearch(string $keyname) // Keynames are Dutch
# examples:
// Brand: TOYOTA
$result->quickSearch('merk')
// Vehicle type: Personenauto
$result->quickSearch('voertuigsoort')
// Track width firste axle: 147
$result->quickSearch('1.spoorbreedte')
// First fuel description, hybrid have two
$set('brandstof_omschrijving', $result->quickSearch('1.brandstof_omschrijving'));
// Second axle legally permitted maximum axle load
$set('aslast', $result->quickSearch('2.wettelijk_toegestane_maximum_aslast'));