278 lines
8.4 KiB
YAML
278 lines
8.4 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: SalvageDB API
|
|
description: API for checking vehicle history and VIN decoding
|
|
version: 1.0.0
|
|
servers:
|
|
- url: /api
|
|
description: Main server
|
|
|
|
paths:
|
|
/search:
|
|
post:
|
|
summary: Search vehicle by VIN
|
|
description: Search for vehicle information by VIN number
|
|
parameters:
|
|
- name: access_code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: API access code for authentication
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
vin:
|
|
type: string
|
|
description: Vehicle Identification Number
|
|
example: "1HGCM82633A123456"
|
|
responses:
|
|
'200':
|
|
description: Successful search
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
found:
|
|
type: boolean
|
|
description: Whether the vehicle was found
|
|
details:
|
|
type: object
|
|
description: Vehicle details
|
|
properties:
|
|
make:
|
|
type: string
|
|
description: Vehicle manufacturer
|
|
model:
|
|
type: string
|
|
description: Vehicle model
|
|
year:
|
|
type: integer
|
|
description: Manufacturing year
|
|
body:
|
|
type: string
|
|
description: Vehicle body type
|
|
engine:
|
|
type: string
|
|
description: Engine model
|
|
cylinders:
|
|
type: string
|
|
description: Number of engine cylinders
|
|
drive:
|
|
type: string
|
|
description: Drive type (FWD/RWD/AWD)
|
|
'400':
|
|
description: Invalid VIN or access code
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error description
|
|
|
|
/decode:
|
|
post:
|
|
summary: Decode VIN
|
|
description: Decode VIN number to get vehicle information
|
|
parameters:
|
|
- name: access_code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: API access code for authentication
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
vin:
|
|
type: string
|
|
description: Vehicle Identification Number
|
|
example: "1HGCM82633A123456"
|
|
responses:
|
|
'200':
|
|
description: Successful decoding
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
make:
|
|
type: string
|
|
description: Vehicle make
|
|
model:
|
|
type: string
|
|
description: Vehicle model
|
|
year:
|
|
type: integer
|
|
description: Manufacturing year
|
|
'400':
|
|
description: Invalid VIN or access code
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error description
|
|
|
|
/detail/{vin}:
|
|
get:
|
|
summary: Get detailed information
|
|
description: Get detailed information about a vehicle by VIN
|
|
parameters:
|
|
- name: vin
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Vehicle Identification Number
|
|
- name: access_code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: API access code for authentication
|
|
responses:
|
|
'200':
|
|
description: Successful information retrieval
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
vin:
|
|
type: string
|
|
description: VIN number
|
|
make:
|
|
type: string
|
|
description: Vehicle make
|
|
model:
|
|
type: string
|
|
description: Vehicle model
|
|
year:
|
|
type: integer
|
|
description: Manufacturing year
|
|
history:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
description: Event date
|
|
event:
|
|
type: string
|
|
description: Event description
|
|
'404':
|
|
description: Vehicle not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error description
|
|
|
|
/restfact:
|
|
get:
|
|
summary: Check account balance
|
|
description: Get current account balance and pricing information
|
|
parameters:
|
|
- name: access_code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: API access code for authentication
|
|
responses:
|
|
'200':
|
|
description: Successful balance check
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
access_code:
|
|
type: string
|
|
description: API access code
|
|
restfact:
|
|
type: number
|
|
description: Current account balance
|
|
'400':
|
|
description: Invalid access code
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error description
|
|
|
|
/restfact_detail:
|
|
get:
|
|
summary: Get request history
|
|
description: Get detailed history of API requests for the last 45 days
|
|
parameters:
|
|
- name: access_code
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: API access code for authentication
|
|
responses:
|
|
'200':
|
|
description: Successful history retrieval
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
access_code:
|
|
type: string
|
|
description: API access code
|
|
report:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
VIN:
|
|
type: string
|
|
description: Vehicle Identification Number
|
|
IP:
|
|
type: string
|
|
description: IP address used for request
|
|
STATUS:
|
|
type: string
|
|
description: Request status (FOUND/NOT FOUND)
|
|
DATETIME:
|
|
type: string
|
|
format: date-time
|
|
description: Request date and time
|
|
COST:
|
|
type: number
|
|
description: Cost of the request
|
|
'400':
|
|
description: Invalid access code
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
error:
|
|
type: string
|
|
description: Error description |