FlightAware Discussions

Codeshare not validating

We’re trying to implement the FlightAware codeshare to verify the different flight numbers for the same flight.
But it doesn’t return the primary operator of the flight.
We have check the documetation and found that FlightInfo are support the codeshare (we use FlightInfo to get the flight data)
src = FlightXML2 Web Services

We have provide the correct inputs (ident & howMany) for FlightInfo, here is the implementation =


protected function getSoapClient()

{

if (empty($this->_soapClient)) {

    $this->_soapClient = new \SoapClient(

        $this->_apiUrl . $this->_soapPath,

        array(

            'trace' => true,

            'exceptions' => 0,

            'login' => $this->_apiUsername,

            'password' => $this->_apiKey

        )

    );

}

return $this->_soapClient;

}

protected function _toArray($object)

{

return json_decode(json_encode($object), true);

}

public function flightInfo($ident, $howMany)

{

$param = array(

    'ident' => $ident,

    'howMany' => intval($howMany)

);



if ($this->_debug) {

    $this->_log('FlightInfo', $param);

}

$result = $this->getSoapClient()->FlightInfo($param);

if ($this->_debug) {

    $this->_log('FlightInfo return:', array($result));

}

return $result;

}

//call function example

$flightInfoResult = $this->_toArray($this->flightInfo($flightCode, 15));


But it still not working on codeshare
return result when we are using S74736

[2021-03-24 03:43:56] main.DEBUG: FlightInfo return: ["[object] (SoapFault(code: 0): NO_DATA no data available at /home/cloudpanel/htdocs/melair/app/code/Omnyfy/FlightAware/Helper/Data.php:144)"]

But it works when we are using the primary operator flight code QR905

Unfortunately, it appears that the look up by IATA code is not working for this carrier. If you search for the ICAO (SBI) the data is returned. As the documentation states When specifying an airline with flight number, either an ICAO or IATA code may be used to designate the airline, however ambiguous or conflicting IATA code assignments do exist so use of ICAO codes is strongly recommended.