Account Setup TOP ↑
Bilweb's Web Service (BWService) is a RESTful API which provides pragmatic access to upload and fetch vehicle objects from bilweb.se
API Key
Every call to BWService API requires a valid API-KEY to be present in request headers. To get your API key, please contact us at erik@bilweb.se.
API key must be sent in a custom request header as follows:
header | BW-API-KEY |
value | YOUR_API_KEY |
Example
POST /bwservice/api/vehicle HTTP/1.1 Host: bilweb.se BW-API-KEY: YOUR_API_KEY
Endpoints
Here's a list of API endpoints/calls you can make:
- Upload Vehicle => POST /vehicle
- Fetch Single Vehicle => GET /vehicle/id/:id
- Fetch Vehicle's List => GET /vehicles
- Delete Vehicle => DELETE /vehicle/id/:id
Environments/Modes
You can use BWService API in both test and live modes at the same time.
Here are the URL prefixes to access the API:
Test Mode | http://test.bilweb.se/bwservice/api |
Live Mode | https://bilweb.se/bwservice/api |
Matching Car Dealer Locations
To be able to post vehicles to the correct car dealer we need to match car dealer locations. Bilweb's webservice provides two options on matching car dealers.
- A: You can use Bilwebs location_id, in this case we will give you our locations ids and you need to send our id with the vehicle post.
- B: You can use your own location ids, in this case you have to provide Bilweb your car dealers with ids and you'll send your ids with vehicle post
Upload Vehicle TOP ↑
Title |
Upload Vehicle
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL |
/vehicle
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method |
POST
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL Params | None | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data Params |
Example:{ location_id: '123456', vehicle_id: '112233', registration_number: 'ABC123', brand: 'Volvo', model: 'V70', verson: 'D2 Momentum Värmare', model_year: 2010, mileage: 4000, price: 80000.5, discounted_price: 75000.5, colour: 'Blå metallic', gear_box: 'Automatisk', fuel: 'Bensin', body: 'Sedan', equipment: 'Avdragbar moms, AC, PDC, Elhissar, Elspeglar', first_registration_date: '2010/10/25', fuel_consumption: 10.5, emission_co2: 169, hp: 390, engine_size: '', doors: 4, seats: 4, description: 'selling description of the vehicle', sales_person_name: 'Abraham', sales_person_email: 'salesperson@xyz.com', sales_person_phone: '333-333-4444', is_green: 1, is_deductible: 0, supplier_gaurantee: 'Supplier gaurantee if any', images: { 'http://yourserver.com/images/veh456_1.jpg', 'http://yourserver.com/images/veh456_2.jpg', 'http://yourserver.com/images/veh456_3.jpg' }, supplier_specific1: 'Supplier specific custom data 1', supplier_specific2: 'Supplier specific custom data 2', supplier_specific3: 'Supplier specific custom data 3' } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Success Response |
Example:HTTP Response Code: 200Content: { status: 'Published', url: 'https://bilweb.se/VEHICLE_URL', warning(s): 'warning messages, if any'}
OR Content: { status: 'Under Review', warning(s): 'warning messages, if any'}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Error Response | Example:HTTP Response Code: 400 BAD REQUESTContent: { errorCode: 1000, message: 'Missing Required Field!', field: 'brand', more_info: 'Required field is either missing or empty.' } Possible errorCodes
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample Call |
$.ajax({ url: "/vehicle", dataType: "json", data : { location_id: 'LOC123', vehicle_id: 'veh456', registration_number: 'ABCXYZ', brand: 'Volvo', model: 'V70', verson: 'D2 Momentum Värmare', model_year: 2010, mileage: 4000, price: 80000.5, discounted_price: 75000.5, colour: 'Blå metallic', gear_box: 'Automatisk', fuel: 'Bensin', body: 'Sedan', equipment: 'Avdragbar moms, AC, PDC, Elhissar, Elspeglar', first_registration_date: '2010/10/25', fuel_consumption: 10.5, emission_co2: 169, hp: 390, engine_size: '', doors: 4, seats: 4, description: 'selling description of the vehicle', sales_person_name: 'Abraham', sales_person_email: 'salesperson@xyz.com', sales_person_phone: '333-333-4444', is_green: 1, is_deductible: 0, supplier_gaurantee: 'Supplier gaurantee if any', images: { 'http://yourserver.com/images/veh456_1.jpg', 'http://yourserver.com/images/veh456_2.jpg', 'http://yourserver.com/images/veh456_3.jpg' }, supplier_specific1: 'Supplier specific custom data 1', supplier_specific2: 'Supplier specific custom data 2', supplier_specific3: 'Supplier specific custom data 3' }, type : "POST", success : function(r) { console.log(r); } }); |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Notes |
|
Fetch Single Vehicle TOP ↑
Title |
Fetch Vehicle
|
|||
---|---|---|---|---|
URL |
/vehicle/id/:id or /vehicle?id=:id
|
|||
Method |
GET
|
|||
URL Params |
|
|||
Data Params | None | |||
Success Response |
HTTP Response Code: 200 Content: { location_id: '123456', vehicle_id: '112233', registration_number: 'ABC123', brand: 'Volvo', model: 'V70', verson: 'D2 Momentum Värmare', model_year: 2010, mileage: 4000, price: 80000.5, discounted_price: 75000.5, colour: 'Blå metallic', gear_box: 'Automatisk', fuel: 'Bensin', body: 'Sedan', equipment: 'Avdragbar moms, AC, PDC, Elhissar, Elspeglar', first_registration_date: '2010/10/25', fuel_consumption: 10.5, emission_co2: 169, hp: 390, engine_size: '', doors: 4, seats: 4, description: 'selling description of the vehicle', sales_person_name: 'Abraham', sales_person_email: 'salesperson@xyz.com', sales_person_phone: '333-333-4444', is_green: 1, is_deductible: 0, supplier_gaurantee: 'Supplier gaurantee if any', images: { 'https://bilweb.se/image_1.jpg', 'https://bilweb.se/image_2.jpg', 'https://bilweb.se/image_3.jpg', }, supplier_specific1: 'Supplier specific custom data 1', supplier_specific2: 'Supplier specific custom data 2', supplier_specific3: 'Supplier specific custom data 3' status: 'Published', url: 'https://bilweb.se/VEHICLE_URL_ON_BILWEB' } |
|||
Error Response |
HTTP Response Code: 400 BAD REQUEST Content: { errorCode: 1000, message: 'Missing Required Parameter!', more_info: 'Required Parameter is either missing or its empty' } OR HTTP Response Code: 404 NOT FOUND Content: { errorCode: 1004, message: 'Vehicle Not Found!', more_info: 'No vehicle found for given vehicle_id. Please verify if you're sending the correct vehicle_id' } |
|||
Sample Call |
GET/vehicle/id/veh456
|
Fetch Vehicle's List TOP ↑
Title |
Fetch Vehicle's List
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL |
/vehicles or /vehicles?limit=10&offset=20&sort_by=price&sort_direction=asc
|
||||||||||||
Method |
GET
|
||||||||||||
URL Params |
|
||||||||||||
Data Params | None | ||||||||||||
Success Response |
HTTP Response Code: 200 Content: { totalVehicles: 'TOTAL VEHICLES INVENTORY', offset: 'OFFSET VALUE', limit: 'NUMBER OF VEHICLES FETCHED', sort_by: 'SORT BY FIELD NAME', sort_direction: 'asc OR desc', vehciles: 'LIST OF VEHICLE OBJECTS' } See Vehicle Object |
||||||||||||
Error Response |
Code: 400 BAD REQUEST Content: { errorCode: 1104, message: 'No Vehicle Inventory!', more_info: 'Sorry, we couldn't find any vehicle. It looks you have not uploaded a vehicle yet.' } |
||||||||||||
Sample Call |
GET/vehicle/veh456
|
Delete Vehicle TOP ↑
Title |
Delete Vehicle
|
|||
---|---|---|---|---|
URL |
/vehicle/id/:id or /vehicle?id=:id
|
|||
Method |
DELETE
|
|||
URL Params |
|
|||
Data Params | None | |||
Success Response |
HTTP Response Code: 200 Content: { message: Vehicle (id) has been successfully deleted. } |
|||
Error Response |
HTTP Response Code: 400 BAD REQUEST Content: { errorCode: 1000, message: 'Missing Required Parameter!', more_info: 'Required Parameter is either missing or its empty' } OR HTTP Response Code: 404 NOT FOUND Content: { errorCode: 1004, message: 'Vehicle Not Found!', more_info: 'No vehicle found for given vehicle_id. Please verify if you're sending the correct vehicle_id' } |
|||
Sample Call |
DELETE/vehicle/id/veh456
|
Fetch All Brands TOP ↑
Title |
Fetch Brands
|
---|---|
URL |
/brands
|
Method |
GET
|
URL Params | None |
Data Params | None |
Success Response |
HTTP Response Code: 200 Content: { "brands": [ { "name": "Alfa Romeo" }, { "name": "Aston Martin" }, { "name": "Audi" }, { "name": "Bentley" }, { "name": "BMW" }, { "name": "Cadillac" }, { "name": "Chevrolet" }, { "name": "Chrysler" }, { "name": "Citroen" }, { "name": "Daewoo" }, { "name": "Daihatsu" }, { "name": "Dodge" }, { "name": "Ferrari" }, ..... ] } |
Error Response | None |
Sample Call |
GET/brands
|
Fetch Models By Brand TOP ↑
Title |
Fetch Models By Brand
|
|||
---|---|---|---|---|
URL |
/models/brandname/:brandname
|
|||
Method |
GET
|
|||
URL Params |
|
|||
Data Params | None | |||
Success Response |
HTTP Response Code: 200 Content: { "models": [ { "name": "A8" }, { "name": "S3" }, { "name": "S4" }, { "name": "S8" }, { "name": "S6" }, { "name": "A2" }, { "name": "RS4" }, { "name": "90" }, { "name": "V8" }, { "name": "RS6" }, { "name": "Q7" }, { "name": "Allroad" }, ..... ] } |
|||
Error Response | None | |||
Sample Call |
HTTP Response Code: 400 BAD REQUEST Content: { errorCode: 1000, message: 'Missing Required Parameter!', more_info: 'Required Parameter is either missing or its empty' } OR HTTP Response Code: 404 NOT FOUND Content: { errorCode: 1004, message: 'Models Not Found!', more_info: 'No Models found for given brand name. Please verify if you're sending the correct brand name' } |