XML-Interface: Difference between revisions

From FSAirlinesWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 158: Line 158:
| SUCCESS, NOT FOUND
| SUCCESS, NOT FOUND
| ts, value, reason
| ts, value, reason
|-
| getAircraftData
| va_id, ac_id
| SUCCESS, NOT FOUND
| id, va_id, acdb_id, location, va_id, user_id, lease_id, fleet_id, status, value, registration, fuel, state, ac_name, stateeng1, stateeng2, stateeng3, stateeng4, stategear, statehull, img_path
|-
| getPilotID
| va_id, user, passwd
| SUCCESS, NOT FOUND
| id
|-
| getRouteList
| va_id
| SUCCESS, NOT FOUND
| id, number, dep, dep_country, arr, arr_country, deptime, arrtime, simrate, days, price, state, flighttype, acdb_list, ac_id
|-
| getAircraftDBList
| va_id
| SUCCESS, NOT FOUND
| id, manufacturer, type, icao
|-
| getFlightReports
| va_id, (acdb_id), (ac_id), (pilot_id), (days), (count)
| SUCCESS, NOT FOUND
| id, dep, arr, pln_arr, ts, pax, ac_type, distance, rating, salary, income, pilot_id, pic, pid, fuel_used, flighttype, hours, ac_id, number, deptime, arrtime, pln_deptime, pln_arrtime, route_id, va_id, va
|-
| getBookableRoutes
| va_id, pilot_id
| SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE
| number, dep, arr, deptime, arrtime, id, state, simrate, flighttype, training, price, list, ac_id
|-
| getBookableAircraft
| va_id, pilot_id, route_id
| SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE
| type, registration, state, id, name, fuel
|-
| bookFlight
| va_id, pilot_id, passwd, route_id, ac_id
| SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE
| success, message, codeshare, codeshare_msg
|-
| getBookStatus
| va_id, pilot_id
| SUCCESS, NOT FOUND
| status
|-
| cancelFlight
| va_id, pilot_id, passwd
| SUCCESS, NOT FOUND
| result, loss
|-
| getAirlineData
| va_id, id (=va_id)
| SUCCESS, NOT FOUND
| id, name, base, code, budget, homepage, logo_l, logo_s, price, reputation, pilotcharge, multiplier, mission
|-
| getTransferCost
| va_id, arr, dep
| SUCCESS, NOT FOUND
| cost
|-
| transferPilot
| va_id, pilot_id, passwd, icao
| SUCCESS, NOT FOUND, INSUFFICIENT FUNDS
| cost
|-
| createAccount
| va_id, givenname, surname, username, email, password, airport, accept_pp
| SUCCESS, NOT FOUND
| success, message, code
|-
| getPrivacyPolicy
| va_id
| SUCCESS
| policy
|}
|}
===Reports===
===Reports===

Revision as of 20:04, 17 October 2010

The XML-Interface is the core of the VA Integration Kit. It has been designed to enable Virtual Airlines to show nearly any kind of data live on their homepage. The data received is in the XML-format so an airline adapt it to their own homepage design.

Basic Usage

The data can be received by using HTTP calls to the interface script and add the desired function to the parameters. Here is an example request:

http://www.fsairlines.net/va_interface.php5?function=getPilotList&va_id=7

As you can see there is the interface script va_interface.php5, the function getPilotList and one function parameter va_id=7. Some functions require additional parameters, these can be appended after the va_id.

The result of the request will be given in xml format with base-tag being <fsa_output>. This tag has the attributes version and success which show the version number of the interface and the if the request succeeded or not. In case of a failure the success-attribute shows the error message. The following example shows the return text of the above function:

<fsa_output version="1.0" success="SUCCESS">
  <data id="1" name="Konrad" surname="Pustka" va_user="SNA101" rank_id="1776" location="EDDM" lastactive="1287330550" status="" budget="198144" />
  <data id="2" name="Claudio" surname="Gusmini" va_user="SNA102" rank_id="1776" location="EDDM" lastactive="1286366261" status="" budget="216405101" />
</fsa_output>

Inside the fsa_output-tag there are all the data-tags which contain all the information. To use this data in your own webpage you need some knowledge in dynamic web-programming, for example PHP. We can't give you a complete introduction into PHP, but you can always have a look at the Official FSAirlines Integration Pack and see how we readout the data.

Data

The following section contains a detailed list of all the request-functions with their return values.

Aircraft Data

Function Parameters<ref>All parameters are mandatory</ref> Return Codes Data
getAircraftDBData va_id, acdb_id SUCCESS, NOT FOUND id, manufacturer, type, icao, passengers, price, fuel, dow, mtow, speed, engines, cargo, mzfw, market_only, range
getAircraftList va_id SUCCESS, NOT FOUND id, acdb_id, icao, value, location, registration, state, ac_name, status, fleet_id, fuel
getAircraftStats va_id, ac_id SUCCESS, NOT FOUND flights, hours, distance
getAirlineStats va_id SUCCESS, NOT FOUND id, flights, rating, hours, distance, last, fuel_used, pax, cargo_kg
getAirportData va_id, icao SUCCESS, NOT FOUND id, name, iata, icao, city, country, la_g, la_p, la_s, la_d, lat, lo_g, lo_p, lo_s, lo_d, lon, altitude, length, fuel, size
getAirportList va_id SUCCESS, NOT FOUND icao, name, city, country, fuel, lat, lon
getCountryStats va_id, country SUCCESS, NOT FOUND va_name, id, flights, rating hours, profit, distance, last, fuel_used, pax, cargo_kg
getFleetAircraftList va_id, fleet_id SUCCESS, NOT FOUND id, acdb_id, icao, value, location, registration, state, ac_name, status, fleet_id, fuel
getFleetList va_id SUCCESS, NOT FOUND id, name
getFleetStats va_id SUCCESS, NOT FOUND id, flights, hours, distance, last, fuel_used, profit, cargo_kg, pax
getPeriodFleetStats va_id, from_ts, to_ts SUCCESS, NOT FOUND id, flights, hours, distance, last, fuel_used, profit, cargo_kg, pax
getLeasedAircraftList va_id SUCCESS, NOT FOUND id, acdb_id, icao, value, location, registraion, state, ac_name, status, fleet_id, fuel, va_id, name, expire
getPilotList va_id SUCCESS, NOT FOUND id, name, surname, user, va_user, rank_id, location, last_active, status, budget
getPilotData va_id, pilot_id SUCCESS, NOT FOUND id, name, surname, user, va_user, rank_id, location, budget, lastactive, active, sigac, timezone, weightunit, language, msgmail, flights, rating, hours, distance, pax, cargo_kg
getPilotHours va_id, pilot_id SUCCESS, NOT FOUND id, manufacturer, type, icao, hours
getPilotRatings va_id, pilot_id SUCCESS, NOT FOUND id, training, manufacturer, type
getPilotStats va_id SUCCESS, NOT FOUND id, flights, rating, hours, distance, last, fuel_used, profit, cargo_kg, pax
getPeriodPilotStats va_id, from_ts, to_ts SUCCESS, NOT FOUND id, flights, rating, hours, distance, last, fuel_used, profit, cargo_kg, pax
getPilotStatus va_id, pilot_id SUCCESS, NOT FOUND ac_id, route_id, departure, arrival, dep_time, dist, duration, status, lon, lat, flightstate, passengers, income, ticket, timestamp, cargo, multiplier, flighttype
getRankList va_id SUCCESS, NOT FOUND id, name, short, settings, pilots, aircrafts, fleet, flights, partnerships, advertisements, fleet_id
getReportDetail va_id, report_id SUCCESS, NOT FOUND id, ac_type, ac_id, pic, pilot_id, number, dep, pln_arr, arr, deptime, loc_deptime, arrtime, loc_arrtime, hours, ts, flightstate, rating, ratingreasons, distance, pax, ticket, crew, salary, fuelprice, fuel_bought, fuel_used, profit, version, simrate, multiplier, bonus, cargo, cargo_kg, flighttype, comment, cheat
getRouteData va_id, route_id SUCCESS, NOT FOUND id, va_id, cs_vaid, number, dep, arr, deptime, arrtime, simrate, days, price, state, flighttype
getActiveFlights va_id SUCCESS, NOT FOUND departure, arrival, passengers, cargo, user_id, ac_id, flightstate, timestamp
getBookedFlights va_id SUCCESS, NOT FOUND departure, arrival, passengers, cargo, user_id, ac_id
getPosTransactionSums va_id SUCCESS, NOT FOUND value, reason
getNegTransactionSums va_id SUCCESS, NOT FOUND value, reason
getLast10Transactions va_id SUCCESS, NOT FOUND ts, value, reason
getAircraftData va_id, ac_id SUCCESS, NOT FOUND id, va_id, acdb_id, location, va_id, user_id, lease_id, fleet_id, status, value, registration, fuel, state, ac_name, stateeng1, stateeng2, stateeng3, stateeng4, stategear, statehull, img_path
getPilotID va_id, user, passwd SUCCESS, NOT FOUND id
getRouteList va_id SUCCESS, NOT FOUND id, number, dep, dep_country, arr, arr_country, deptime, arrtime, simrate, days, price, state, flighttype, acdb_list, ac_id
getAircraftDBList va_id SUCCESS, NOT FOUND id, manufacturer, type, icao
getFlightReports va_id, (acdb_id), (ac_id), (pilot_id), (days), (count) SUCCESS, NOT FOUND id, dep, arr, pln_arr, ts, pax, ac_type, distance, rating, salary, income, pilot_id, pic, pid, fuel_used, flighttype, hours, ac_id, number, deptime, arrtime, pln_deptime, pln_arrtime, route_id, va_id, va
getBookableRoutes va_id, pilot_id SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE number, dep, arr, deptime, arrtime, id, state, simrate, flighttype, training, price, list, ac_id
getBookableAircraft va_id, pilot_id, route_id SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE type, registration, state, id, name, fuel
bookFlight va_id, pilot_id, passwd, route_id, ac_id SUCCESS, NOT FOUND, FLIGHT BOOKED, GROUNDED, SUSPENDED, VA INACTIVE success, message, codeshare, codeshare_msg
getBookStatus va_id, pilot_id SUCCESS, NOT FOUND status
cancelFlight va_id, pilot_id, passwd SUCCESS, NOT FOUND result, loss
getAirlineData va_id, id (=va_id) SUCCESS, NOT FOUND id, name, base, code, budget, homepage, logo_l, logo_s, price, reputation, pilotcharge, multiplier, mission
getTransferCost va_id, arr, dep SUCCESS, NOT FOUND cost
transferPilot va_id, pilot_id, passwd, icao SUCCESS, NOT FOUND, INSUFFICIENT FUNDS cost
createAccount va_id, givenname, surname, username, email, password, airport, accept_pp SUCCESS, NOT FOUND success, message, code
getPrivacyPolicy va_id SUCCESS policy

Reports

Statistics

Interactive

Flights

<references />