Skip to content

HTTP Macro for easier access to Vegvesen Kjøretøydata API

Notifications You must be signed in to change notification settings

eeappno/vegvesen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Plugin for Vegvesen API Integration

This Laravel plugin facilitates integration with the Vegvesen API, providing access to vehicle information and data. The Vegvesen API, maintained by the Norwegian Public Roads Administration, offers various endpoints for retrieving vehicle details. For detailed information on using the Vegvesen API, refer to the Vegvesen API Documentation.

Installation

Install the plugin via Composer:

composer require eeappdev/vegvesen

Configuration

Publish the configuration file to customize your Vegvesen API settings:

php artisan vendor:publish --provider="Eeappdev\Vegvesen\VegvesenServiceProvider"

After publishing, you'll find the vegvesen.php configuration file in your config directory. Update the following environment variables in your .env file with your Vegvesen API credentials:

VEGVESEN_BASEURL=
VEGVESEN_TOKEN=

If you don't specify VEGVESEN_BASEURL in your .env file, the default value from the vegvesen.php configuration file will be used.

Usage

Use the Http::vegvesen() macro to make requests to the Vegvesen API:

use Illuminate\Support\Facades\Http;

$response = Http::vegvesen()->get('kjoretoydata?kjennemerke={registreringsnummer}');
$response = Http::vegvesen()->get('kjoretoydata?understellsnummer={vin nummer}');

Replace {registreringsnummer} or {vin nummer} with the appropriate vehicle registration number or VIN number. Adjust the endpoint and request parameters according to your API needs. Refer to the Vegvesen API Documentation for detailed information on available endpoints and request formats.

About

HTTP Macro for easier access to Vegvesen Kjøretøydata API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages