openapi: 3.0.3 info: title: 'InfoServices API Documentation' description: '' version: 1.0.0 servers: - url: 'https://infoservices.guisoft.pt' tags: - name: Authentication description: "\nAPIs for user authentication" - name: Vehicles description: "\nAPIs for retrieving vehicle information" components: securitySchemes: default: type: http scheme: bearer description: 'Use the `key` given to you to authenticate.' security: - default: [] paths: /api/auth/login: post: summary: 'Authenticate a user and generate an API token' operationId: authenticateAUserAndGenerateAnAPIToken description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Login successful' token: 1|a1b2c3d4e5f6g7h8i9j0... properties: message: type: string example: 'Login successful' token: type: string example: 1|a1b2c3d4e5f6g7h8i9j0... 401: description: '' content: application/json: schema: type: object example: message: Unauthorized properties: message: type: string example: Unauthorized tags: - Authentication requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The username of the user.' example: john_doe nullable: false password: type: string description: 'The password of the user.' example: password123 nullable: false required: - name - password security: [] '/api/vehicle/plate/{plate}/mileage': get: summary: 'Get vehicle mileage by license plate' operationId: getVehicleMileageByLicensePlate description: 'This endpoint retrieves the mileage information for a vehicle identified by its license plate.' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"data\": {\n \"plate\": \"07IS81\",\n \"vin\": \"TEST82633A123456\",\n \"events\": [\n {\n \"event_date\": \"2015-10-13 00:00:00\",\n \"vehicle_mileage\": 200000\n },\n {\n \"event_date\": \"2015-03-06 00:00:00\",\n \"vehicle_mileage\": 171000\n },\n ]\n }\n}" 403: description: '' content: application/json: schema: type: object example: message: 'This action is unauthorized.' properties: message: type: string example: 'This action is unauthorized.' 404: description: '' content: application/json: schema: type: object example: message: 'Vehicle not found' properties: message: type: string example: 'Vehicle not found' tags: - Vehicles parameters: - in: path name: plate description: 'The license plate of the vehicle.' example: 07-IS-81 required: true schema: type: string '/api/vehicle/vin/{vin}/mileage': get: summary: 'Get vehicle mileage by VIN' operationId: getVehicleMileageByVIN description: 'This endpoint retrieves the mileage information for a vehicle identified by its Vehicle Identification Number (VIN).' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"data\": {\n \"plate\": \"07IS81\",\n \"vin\": \"TEST82633A123456\",\n \"events\": [\n {\n \"event_date\": \"2015-10-13 00:00:00\",\n \"vehicle_mileage\": 200000\n },\n {\n \"event_date\": \"2015-03-06 00:00:00\",\n \"vehicle_mileage\": 171000\n },\n ]\n }\n}" 403: description: '' content: application/json: schema: type: object example: message: 'This action is unauthorized.' properties: message: type: string example: 'This action is unauthorized.' 404: description: '' content: application/json: schema: type: object example: message: 'Vehicle not found' properties: message: type: string example: 'Vehicle not found' tags: - Vehicles parameters: - in: path name: vin description: 'The Vehicle Identification Number (VIN).' example: 1TEST82633A123456 required: true schema: type: string