Jump to content

<p>vaCentral Documentation</p>


Nabeel
  • The vaCentral integration class

    This class is provided to help integrate your non-phpVMS VA integrate into vaCentral. Read the file for more information and details.

    vacentral_xml.php

    Integration XML Details

    update_vainfo - This data should be sent upto 3 times a day (any more than that will not be allowed)

    <?xml version="1.0"?>
    <vacentral>
    <siteurl> </siteurl>
    <apikey> </apikey>
    <version> </version>
    <debug> </debug>
    <method>update_vainfo</method>
    <pilotcount> </pilotcount>
    <totalhours>5.39</totalhours>
    <totalflights>2</totalflights>
    <totalschedules></totalschedules>
    <expenses>0</expenses>
    <expensescost></expensescost>
    <livefuel>1</livefuel>
    </vacentral>
    

    • pilotcount - The total number of pilots registered for your VA
    • totalhours - Total number of flight hours - hh.mm
    • totalflights - Total number of PIREPs
    • totalschedules - The total number of schedules
    • expenses - The number of expenses (set to 0 if you're not using).
    • expensescost - Per-month cost of expenses
    • livefuel - 0 or 1, if you're using prices from the API server for fuel

    update_schedules - This is updating your schedules listed on vaCentral

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>update_schedules</method>
    <total></total>
    <schedule>
    <flightnum></flightnum>
    <depicao></depicao>
    <arricao></arricao>
    <route></route>
    <aircraft></aircraft>
    <registration></registration>
    <distance></distance>
    <deptime>4:30AM EST</deptime>
    <arrtime>11:00AM EST</arrtime>
    <daysofweek>0123456</daysofweek>
    <maxload>0</maxload>
    <price>759</price>
    <flighttype>P</flighttype>
    <notes></notes>
    </schedule>
    
    <schedule>
    ...
    </schedule>
    
    </vacentral>
    

    This is a list of all your routes/schedules for your airline.

    • total - This is the total number of schedules

    Then each schedule is sent in a <schedule> </schedule> block

    • flightnum - Alphanumeric, flight number, including the code (VMA0002, AA343A, etc)
    • depicao - The departure ICAO
    • arricao - The arrival ICAO
    • route - Flight route, leave blank if none
    • aircraft - Aircraft type (ie, B747-400)
    • registration - Aircraft registration for this flight, leave blank if none
    • distance - Total distance for this flight (from ICAO to ICAO, or total for route. In nautical miles)
    • deptime - Estimated time for departure, as HH.MM (AM/PM) (TIMEZONE)
    • arrtime - Estimated time of arrival, as HH.MM (AM/PM) (TIMEZONE)
    • daysofweek - Days of week flight is active (0-Sunday, 6-Saturday)
    • maxload - Maximum number of passengers or amount of cargo. 0 for nothing
    • price - Ticket price, or price per cargo unit. 0 for nothing
    • flighttype - P for passenger, C for cargo, H for charter
    • notes - Any notes for the schedule

    You can either add or update schedules this way. Changes are determined on the flight number (if the flight number exists, then the schedule will be updated).

    ==== Sending Data ====

    The API server is located at

    http://api.vacentral.net

    All of your XML requests have to be sent as raw POST text to:

    http://api.vacentral.net/update

    To do this using cURL, it would be something like:

    <code php>

    curl_setopt($this->curl, CURLOPT_POST, 1);

    curl_setopt($this->curl, CURLOPT_POSTFIELDS, urlencode($xml));

    </code>

    Where $xml is the string containing the XML.

    Every request will have the following header:

    <siteurl> </siteurl>
    <apikey> </apikey>
    <version> </version>
    <debug> </debug>
    <method>update_vainfo</method>
    

    ==== Responses ====

    From the server, you'll get a response similar to:

    <message>
     <responsecode>200</responsecode>
     <type>Success</type>
     <detail>Updated 20 of 20 PIREPs</detail>
    </message>

    * **siteurl** This should match the URL you entered for your airline, in your vaCentral profile

    * **apikey** This is your vaCentral API key

    * **version** - all numeric (nn.nn.nn or nn.nn), version number of your app

    * **debug** - 1 or 0 for extra debug information (set to 0 as default)

    * **method** - this is the type of update:

    * update_vainfo - Updates your VA's general info

    * update_schedules - Send all of your schedules

    * update_pilots - Send your pilot's information

    * update_pireps - Send ALL of your PIREPs (deletes all your previous PIREPs and sends a fresh list)

    * send_pirep - Send a single PIREP in

    * update_acars - Send ALL of your current ACARS flights

    * update_acars_flight - Update a single ACARS flight

    Response Code:

    * 200 - Success

    * 400 - Invalid XML received

    * 401 - Invalid API key

    Type:

    * Success

    * Error

    Detail:

    * Details of what happened

    ===== update_vainfo =====

    This data should be sent upto 3 times a day (any more than that will not be allowed)

    <?xml version="1.0"?>
    <vacentral>
    <siteurl> </siteurl>
    <apikey> </apikey>
    <version> </version>
    <debug> </debug>
    <method>update_vainfo</method>
    <pilotcount> </pilotcount>
    <totalhours>5.39</totalhours>
    <totalflights>2</totalflights>
    <totalschedules></totalschedules>
    <expenses>0</expenses>
    <expensescost></expensescost>
    <livefuel>1</livefuel>
    </vacentral>

    * pilotcount - The total number of pilots registered for your VA

    * totalhours - Total number of flight hours - hh.mm

    * totalflights - Total number of PIREPs

    * totalschedules - The total number of schedules

    * expenses - The number of expenses (set to 0 if you're not using).

    * expensescost - Per-month cost of expenses

    * livefuel - 0 or 1, if you're using prices from the API server for fuel

    ===== update_schedules =====

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>update_schedules</method>
    <total></total>
     <schedule>
     	<flightnum></flightnum>
     	<depicao></depicao>
     	<arricao></arricao>
     	<route></route>
     	<aircraft></aircraft>
     	<registration></registration>
     	<distance></distance>
     	<deptime>4:30AM EST</deptime>
     	<arrtime>11:00AM EST</arrtime>
     	<daysofweek>0123456</daysofweek>
     	<maxload>0</maxload>
     	<price>759</price>
     	<flighttype>P</flighttype>
     	<notes></notes>
      </schedule>
    
      <schedule>
    ...
      </schedule>
    
    </vacentral>

    This is a list of all your routes/schedules for your airline.

    * total - This is the total number of schedules

    Then each schedule is sent in a <schedule> </schedule> block

    * **flightnum** - Alphanumeric, flight number, including the code (VMA0002, AA343A, etc)

    * **depicao** - The departure ICAO

    * **arricao** - The arrival ICAO

    * **route** - Flight route, leave blank if none

    * **aircraft** - Aircraft type (ie, B747-400)

    * **registration** - Aircraft registration for this flight, leave blank if none

    * **distance** - Total distance for this flight (from ICAO to ICAO, or total for route. In nautical miles)

    * **deptime** - Estimated time for departure, as HH.MM (AM/PM) (TIMEZONE)

    * **arrtime** - Estimated time of arrival, as HH.MM (AM/PM) (TIMEZONE)

    * **daysofweek** - Days of week flight is active (0-Sunday, 6-Saturday)

    * **maxload** - Maximum number of passengers or amount of cargo. 0 for nothing

    * **price** - Ticket price, or price per cargo unit. 0 for nothing

    * **flighttype** - P for passenger, C for cargo, H for charter

    * **notes** - Any notes for the schedule

    You can either add or update schedules this way. Changes are determined on the flight number (if the flight number exists, then the schedule will be updated).

    ===== update_pilots =====

    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version>1</version>
    <debug>0</debug>
    <method>update_pilots</method>
    <total>=</total>
    <pilot>
     <pilotid></pilotid>
     <pilotname></pilotname>
     <location></location>
    </pilot>
    <pilot>
    ....
    </pilot>
    </vacentral>

    * total - The total number of pilots being sent

    Then each pilot is sent in a <pilot> </pilot> block.

    * pilotid - The full Pilot ID

    * pilotname - The full pilot name

    * location - The country code

    Currently, this information is not saved server-side, but exists for future expansion.

    ===== update_pireps =====

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>update_pireps</method>
    <total></total>
    <pirep>
     <uniqueid></uniqueid>
     <pilotid></pilotid>
     <pilotname></pilotname>
     <flightnum></flightnum>
     <depicao></depicao>
     <arricao></arricao>
     <aircraft></aircraft>
     <registration></registration>
     <flighttime></flighttime>
     <submitdate></submitdate>
     <flighttype></flighttype>
     <load></load>
     <fuelused></fuelused>
     <fuelprice></fuelprice>
     <pilotpay></pilotpay>
     <price></price>
     <revenue></revenue>
    </pirep>
    <pirep>
     ....
    </pirep>
    </vacentral>

    * total - the total number of pireps being sent

    Each PIREP is sent in a pirep block:

    * uniqueid - This is a unique ID for the PIREP, presumably, your primary key ID.

    * pilotid - The full pilot ID

    * pilotname - The full name of hte pilot

    * flightnum - The full flight number

    * depicao

    * arricao

    * aircraft - The aircraft name

    * registration - Aircraft registration

    * flightime - the flight time (HH.MM format)

    * submitdate - unix timestamp of when it was submitted

    * flighttype - P for passenger, C for cargo, H for charter

    * load - total passengers or cargo on flight

    * fuelused - the total fuel used

    * fuelprice - the total cost of fuel (fuelused * unit cost)

    * pilotpay - Pilot pay for flight

    * price - price for flight per ticket

    * revenue - total revenue for flight

    You can also call this to update existing PIREPs, where the unique_id matches the PIREP you want to update. You can update multiple PIREPs at once, by sending multiple pirep blocks.

    ===== add_pirep =====

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>add_pirep</method>
    <total></total>
    <pirep>
     <uniqueid></uniqueid>
     <pilotid></pilotid>
     <pilotname></pilotname>
     <flightnum></flightnum>
     <depicao></depicao>
     <arricao></arricao>
     <aircraft></aircraft>
     <registration></registration>
     <flighttime></flighttime>
     <submitdate></submitdate>
     <flighttype></flighttype>
     <load></load>
     <fuelused></fuelused>
     <fuelprice></fuelprice>
     <pilotpay></pilotpay>
     <price></price>
     <revenue></revenue>
    </pirep>
    </vacentral>

    This is to add a single PIREP. See update_pireps

    ===== remove_pireps =====

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>update_pireps</method>
    <total></total>
    <pirep>
     <uniqueid></uniqueid>
    </pirep>
    <pirep>
     ...
    </pirep>
    </vacentral>

    ===== update_acars_flight =====

    <?xml version="1.0"?>
    <vacentral>
    <siteurl></siteurl>
    <apikey></apikey>
    <version></version>
    <debug>0</debug>
    <method>update_acars_flight</method>
    <flight>
     <unique_id></unique_id>
     <client></client>
     <pilotid></pilotid>
     <pilotname></pilotname>
     <depicao></depicao>
     <arricao></arricao>
     <deptime></deptime>
     <arrtime></arrtime>
     <flightnum></flightnum>
     <aircraft></aircraft>
     <lat></lat>
     <lng></lng>
     <heading></heading>
     <phase>Enroute</phase>
     <alt></alt>
     <gs></gs>
     <distremain></distremain>
     <timeremain></timeremain>
     <lastupdate></lastupdate>
    </flight>
    </vacentral>

    * unique_id - This is the unique, primary key id in your database

    * client - client name (ie, "xacars", "fsacars", "va_custom", etc)

    * pilotid - The full pilot ID (VMA0001)

    * pilotname - The full pilot name

    * depicao - Departure ICAO

    * arricao - Arrival ICAO

    * deptime - Departure time, in local time (unix timestamp or full time string)

    * arrtime - Arrival time (estimated)

    * flightnum - Flight number

    * aircraft - Aircraft name (registration optional, name is better)

    * lat - Current latitude

    * lng - Current longtitude

    * heading

    * phase - text of current phase (blank defaults to "Enroute")

    * alt - Current altitude, in feet, full

    * gs - Groundspeed, knots

    * distremain - distance till arrival

    * timeremain - time remaining till arrival

    * lastupdate - unix timestamp of last update


User Feedback

Recommended Comments

There are no comments to display.



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...