{ "openapi": "3.0.1", "info": { "title": "IVAO Event Flight Booking System", "description": "API privada Event Flight Booking IVAO", "contact": { "email": "br-web@ivao.aero" }, "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8080" }, { "url": "https://api.booking.br.ivao.aero" }, { "url": "https://api.booking.stage.br.ivao.aero" } ], "tags": [ { "name": "Auth" }, { "name": "User" }, { "name": "Event" }, { "name": "Slot" }, { "name": "Scenery" }, { "name": "Logo" } ], "paths": { "/user": { "get": { "tags": [ "User" ], "summary": "Get User List - Admin Only", "parameters": [ { "name": "suspended", "in": "query", "schema": { "type": "boolean" }, "required": false }, { "name": "vid", "in": "query", "schema": { "type": "string" }, "required": false }, { "name": "page", "in": "query", "schema": { "type": "number" }, "required": false }, { "name": "perPage", "in": "query", "schema": { "type": "number" }, "required": false } ], "responses": { "200": { "description": "User list according filters", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Pagination" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/User" } } } } ] } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } }, "security": [ { "authentication": [] } ] } }, "/user/{userId}": { "patch": { "tags": [ "User" ], "summary": "Update user - Admin only", "parameters": [ { "name": "userId", "in": "path", "schema": { "type": "number" }, "required": true } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "suspended": { "type": "boolean" } } } } } }, "responses": { "200": { "description": "User updated" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" }, "404": { "description": "User not founded" } }, "security": [ { "authentication": [] } ] } }, "/auth": { "post": { "tags": [ "Auth" ], "summary": "Do Auth base on IVAO Token", "requestBody": { "description": "IVAO Token", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ivao-token": { "type": "string" } } } } } }, "responses": { "200": { "description": "JWT Token", "content": { "application/json": { "schema": { "type": "object", "properties": { "jwt": { "type": "string" } } } } } }, "403": { "description": "Invalid IVAO Token" } } }, "get": { "tags": [ "Auth" ], "summary": "Get Auth data from a given JWT", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "JWT Token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "401": { "description": "Invalid User" } } } }, "/event": { "post": { "tags": [ "Event" ], "summary": "Create a new event", "requestBody": { "description": "Event Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dateStart": { "type": "number", "description": "Timestamp of start date" }, "dateEnd": { "type": "number", "description": "Timestamp of end date" }, "eventName": { "type": "string" }, "privateSlots": { "type": "boolean", "description": "Indicate if there is private slots" }, "pilotBriefing": { "type": "string", "description": "URL for Pilot Briefing" }, "atcBriefing": { "type": "string", "description": "URL for ATC Briefing" }, "description": { "type": "string", "description": "Event description" }, "banner": { "type": "string", "description": "Event Banner Link" }, "atcBooking": { "type": "string", "description": "Link to event ATC Booking" }, "airports": { "type": "string", "description": "List of airports on this event, separated by ',' (eg: SBKP,SBRF,SBEG)" }, "type": { "type": "string", "description": "Event Type", "enum": [ "rfe", "rfo" ] } } } } } }, "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Event successfully created" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "get": { "tags": [ "Event" ], "summary": "Fetch events", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Event result", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Pagination" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } ] } } } }, "401": { "description": "User not authenticated" } }, "parameters": [ { "name": "status", "in": "query", "description": "Event status", "required": false, "schema": { "type": "string", "enum": [ "created", "scheduled", "finished" ] } }, { "name": "showAll", "in": "query", "description": "If disabled: shows only scheduled and created events", "required": false, "schema": { "type": "boolean" } } ] } }, "/event/{eventId}": { "get": { "tags": [ "Event" ], "summary": "Fetch a single Event", "parameters": [ { "name": "eventId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Event result", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Pagination" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } ] } } } }, "401": { "description": "User not authenticated" } } }, "put": { "tags": [ "Event" ], "requestBody": { "description": "Event Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dateStart": { "type": "number", "description": "Timestamp of start date" }, "dateEnd": { "type": "number", "description": "Timestamp of end date" }, "eventName": { "type": "string" }, "privateSlots": { "type": "boolean", "description": "Indicate if there is private slots" }, "flexibleSlots": { "type": "boolean", "description": "Indicate if user can do own flight or not" }, "status": { "type": "string", "description": "Event status", "enum": [ "created", "scheduled", "finished" ] }, "type": { "type": "string", "description": "Event Type", "enum": [ "rfe", "rfo" ] }, "description": { "type": "string", "description": "Event description" }, "airports": { "type": "string", "description": "List of airports on this event, separated by ',' (eg: SBKP,SBRF,SBEG)" } } } } } }, "summary": "Update a event", "parameters": [ { "name": "eventId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Event successfully updated" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "delete": { "tags": [ "Event" ], "summary": "Delete a event", "parameters": [ { "name": "eventId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Event successfully deleted" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/event/{eventId}/export": { "get": { "tags": [ "Event" ], "parameters": [ { "name": "eventId", "in": "path", "required": true, "schema": { "type": "integer" } } ], "summary": "Export event slot data as .csv file", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Event data", "content": { "text/csv": { "schema": { "type": "string", "format": "binary" } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" }, "404": { "description": "Event not found" } } } }, "/event/{eventId}/slot": { "get": { "tags": [ "Slot" ], "parameters": [ { "name": "eventId", "in": "path", "required": true, "schema": { "type": "integer" } }, { "name": "flightNumber", "in": "query", "schema": { "type": "string" } }, { "name": "type", "in": "query", "schema": { "type": "string", "enum": [ "takeoff", "landing" ] } }, { "name": "private", "in": "query", "schema": { "type": "boolean" } }, { "name": "origin", "in": "query", "schema": { "type": "string" } }, { "name": "destination", "in": "query", "schema": { "type": "string" } }, { "name": "available", "in": "query", "schema": { "type": "boolean", "enum": [true] }, "allowEmptyValue": true } ], "summary": "Get Event slots info", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot result", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Pagination" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Slot" } } } } ] } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "post": { "tags": [ "Slot" ], "parameters": [ { "name": "eventId", "in": "path" } ], "summary": "Create a new slot to a given event", "requestBody": { "description": "Slot Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "takeoff", "landing" ], "description": "Slot type" }, "flightNumber": { "type": "string", "description": "The flight number" }, "origin": { "type": "string", "description": "Departure ICAO (is not required if event has private slots)" }, "destination": { "type": "boolean", "description": "Destination ICAO (is not required if event has private slots)" }, "slotTime": { "type": "string", "description": "Slot time" }, "gate": { "type": "string", "description": "Slot gate" }, "aircraft": { "type": "string", "description": "Aircraft ICAO" }, "private": { "type": "boolean", "description": "Indicate if slot is private" } } } } } }, "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Slot successfully created" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/event/{eventId}/slot/mine": { "get": { "parameters": [ { "name": "eventId", "in": "path", "schema": { "type": "number" }, "required": true } ], "tags": [ "Slot" ], "summary": "Get user slots to a given event", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot result", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Pagination" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Slot" } } } } ] } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/event/{eventId}/slot/count": { "get": { "parameters": [ { "name": "eventId", "in": "path", "schema": { "type": "number" }, "required": true } ], "tags": [ "Slot" ], "summary": "Get slot count by their type", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot count result", "content": { "application/json": { "schema": { "type": "object", "properties": { "departure": { "type": "number" }, "landing": { "type": "number" }, "private": { "type": "number" } } } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/event/{eventId}/slot/overlapping": { "get": { "tags": [ "Slot" ], "summary": "Gets a list of booked slots which are overlapping, grouped by pilotid", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "List of slots grouped by pilot", "content": { "application/json": { } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/slot/{slotId}": { "delete": { "summary": "Delete a given slot", "tags": [ "Slot" ], "parameters": [ { "name": "slotId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot successfully deleted" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "put": { "tags": [ "Slot" ], "summary": "Update user from admin perspective", "parameters": [ { "name": "slotId", "in": "path" } ], "requestBody": { "description": "Slot Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "takeoff", "landing" ], "description": "Slot type" }, "flightNumber": { "type": "string", "description": "The flight number" }, "origin": { "type": "string", "description": "Departure ICAO (is not required if event has private slots)" }, "destination": { "type": "boolean", "description": "Destination ICAO (is not required if event has private slots)" }, "slotTime": { "type": "string", "description": "Slot time" }, "gate": { "type": "string", "description": "Slot gate" }, "aircraft": { "type": "string", "description": "Aircraft ICAO" }, "private": { "type": "boolean", "description": "Indicate if slot is private" } } } } } }, "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot successfully updated" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/slot/{slotId}/{action}": { "patch": { "summary": "Handle user book operation", "tags": [ "Slot" ], "parameters": [ { "name": "action", "in": "path", "schema": { "type": "string", "enum": [ "book", "cancel", "confirm" ] } }, { "name": "slotId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Slot successfully booked" }, "401": { "description": "User not authenticated" } } } }, "/scenery": { "get": { "tags": [ "Scenery" ], "summary": "Get all sceneries", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Scenery result", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Scenery" } } } } }, "401": { "description": "User not authenticated" } } }, "post": { "tags": [ "Scenery" ], "parameters": [ { "name": "eventId", "in": "path" } ], "summary": "Create a new Scenery", "requestBody": { "description": "Scenery Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Scenery Title" }, "license": { "type": "string", "enum": [ "freeware", "payware" ], "description": "The sceney license" }, "link": { "type": "string", "description": "The scenery download link" }, "simulator": { "type": "boolean", "enum": [ "fs9", "fsx", "p3d", "xp11", "msfs" ], "description": "The scenery simulator" } } } } } }, "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Scenery successfully created" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/event/{eventId}/scenery": { "get": { "tags": [ "Scenery" ], "parameters": [ { "name": "eventId", "in": "path" } ], "summary": "Get sceneries for a given event", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Scenery result", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Scenery" } } } } }, "401": { "description": "User not authenticated" } } } }, "/scenery/{sceneryId}": { "delete": { "summary": "Delete a given scenery", "tags": [ "Scenery" ], "parameters": [ { "name": "sceneryId", "in": "path" } ], "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Scenery successfully deleted" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "put": { "tags": [ "Scenery" ], "parameters": [ { "name": "sceneryId", "in": "path" } ], "summary": "Updates a Scenery", "requestBody": { "description": "Scenery Data", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "Scenery Title" }, "license": { "type": "string", "enum": [ "freeware", "payware" ], "description": "The sceney license" }, "link": { "type": "string", "description": "The scenery download link" }, "simulator": { "type": "boolean", "enum": [ "fs9", "fsx", "p3d", "xp11", "msfs" ], "description": "The scenery simulator" } } } } } }, "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Scenery successfully updated" }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/logo/airline/{icao}": { "get": { "tags": [ "Logo" ], "parameters": [ { "name": "icao", "in": "path" } ], "summary": "Get the airline logo for a given airline ICAO code.", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Airline logo, on a fixed height and width PNG file" }, "404": { "description": "Logo not found" } } } }, "/slot/many": { "get": { "tags": [ "Slot" ], "summary": "Get CSV template for many creation", "responses": { "200": { "description": "Slot result", "content": { "application/json": { "schema": { "type": "string", "format": "csv" } } } } } } }, "/airport/details/{icao}": { "get": { "parameters": [ { "name": "icao", "in": "path", "schema": { "type": "string" }, "required": true } ], "tags": [ "Airport" ], "summary": "Get the airport details from IVAO HQ API", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Airport details", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/AirportDetails" } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/aircraft": { "get": { "parameters": [ { "name": "icao", "in": "path", "schema": { "type": "string" }, "required": true } ], "tags": [ "Aircraft" ], "summary": "Get all aircraft registered", "security": [ { "authentication": [] } ], "responses": { "200": { "description": "Aircraft list", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/AirportDetails" } } } }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } }, "post": { "parameters": [ { "name": "iata", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "icao", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "name", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "speed", "in": "query", "schema": { "type": "integer" }, "required": true } ], "tags": [ "Aircraft" ], "summary": "Register an Aircraft", "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Successfully installed", }, "401": { "description": "User not authenticated" }, "403": { "description": "Invalid permissions" } } } }, "/aircraft/{id}": { "put": { "tags": [ "Aircraft" ], "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true }, { "name": "iata", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "icao", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "name", "in": "query", "schema": { "type": "string" }, "required": true }, { "name": "speed", "in": "query", "schema": { "type": "integer" }, "required": true } ], "summary": "Edit an aircraft", "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Edited Succesfully" }, "401": { "description": "User not authenticated" } } }, "delete": { "tags": [ "Aircraft" ], "parameters": [ { "name": "id", "in": "path", "schema": { "type": "string" }, "required": true } ], "summary": "Delete an Aircraft", "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Aircraft Deleted" }, "401": { "description": "User not authenticated" } } } }, "/getMissing": { "get": { "tags": [ "Aircraft" ], "summary": "Gets a list of aircraft which are missing from the system.", "security": [ { "authentication": [] } ], "responses": { "201": { "description": "Edited Succesfully" }, "401": { "description": "User not authenticated" } } } } }, "components": { "securitySchemes": { "authentication": { "type": "http", "scheme": "bearer" } }, "schemas": { "Pagination": { "type": "object", "properties": { "page": { "type": "number" }, "perPage": { "type": "number" }, "total": { "type": "number" } } }, "Scenery": { "type": "object", "properties": { "id": { "type": "number" }, "title": { "type": "string" }, "license": { "type": "string", "enum": [ "freeware", "payware" ] }, "link": { "type": "string" }, "simulator": { "type": "string", "enum": [ "fs9", "fsx", "p3d", "xp11", "msfs" ] } } }, "User": { "type": "object", "properties": { "id": { "type": "number" }, "vid": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "atcRating": { "type": "number" }, "pilotRating": { "type": "number" }, "division": { "type": "string" }, "country": { "type": "string" }, "admin": { "type": "boolean" }, "suspended": { "type": "boolean" } } }, "Slot": { "type": "object", "properties": { "id": { "type": "number" }, "origin": { "type": "string" }, "destination": { "type": "string" }, "type": { "type": "string", "enum": [ "takeoff", "landing" ] }, "private": { "type": "boolean" }, "slotTime": { "type": "string" }, "gate": { "type": "string" }, "aircraft": { "type": "string" }, "flightTime": { "type": "integer", "description": "Flight Time in Seconds" }, "flightDistance": { "type": "integer", "description": "Flight Distance in Nautical Miles" }, "owner": { "$ref": "#/components/schemas/User", "required": false }, "event": { "$ref": "#/components/schemas/Event", "required": false }, "bookingTime": { "type": "string" }, "bookingStatus": { "type": "string", "enum": [ "free", "prebooked", "booked" ] } } }, "Event": { "type": "object", "properties": { "id": { "type": "number" }, "division": { "type": "string" }, "dateStart": { "type": "string" }, "dateEnd": { "type": "string" }, "eventName": { "type": "string" }, "privateSlots": { "type": "boolean" }, "status": { "type": "string", "enum": [ "created", "scheduled", "finished" ] }, "creator": { "$ref": "#/components/schemas/User", "required": false }, "description": { "type": "string" }, "banner": { "type": "string" }, "atcBooking": { "type": "string" }, "atcBriefing": { "type": "string" }, "pilotBriefing": { "type": "string" }, "public": { "type": "boolean" } } }, "AirportDetails": { "type": "object", "properties": { "icao": { "type": "string" }, "iata": { "type": "string" }, "name": { "type": "string" }, "city": { "type": "string" }, "countryId": { "type": "string" }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "military": { "type": "boolean" }, "faaCode": { "type": "string" }, "atcCallsign": { "type": "string" }, "state": { "type": "string" }, "centerId": { "type": "string" }, "firId": { "type": "string" }, "elevation": { "type": "number" }, "magnetic": { "type": "string" }, "transitionAltitude": { "type": "number" }, "web": { "type": "string" } } } } } }