Flight Status by Flight Number

## Content * [API Description](#api-description) * [API Parameters](#api-parameters) * [Input Parameters](#input-parameters) * [Output Parameters](#output-parameters) * [Codes References](#codes-references) * [Canned Reasons](#canned-reasons) * [Error Codes](#error-codes) * [Generic error codes for API](#generic-error-codes-for-api) * [Exception codes](#exception-codes) * [JSON Samples](#json-samples) * [Input Samples 1](#input-sample-1) * [Output Sample 1](#output-sample-1) * [Input Samples 2](#input-sample-2) * [Output Sample 2](#output-sample-2) * [Input Samples 3](#input-sample-3) * [Output Sample 3](#output-sample-3) Request for API key ## API Description ||| |----|----| |**API Name:**| `getbynumber`| |**API Type:**| `Query`| |**API Availability:**| `Public and Partners`| |**API Description:**| `Flight Status retrieval using flight number` ## API Parameters ### HTTP Headers | Headers | Value | Description | | ------------------ | --------- | ---------------------------------------------------------------------------- | |Content-Type|application/json|| |apikey|*|An active SQ API Key for the FlightStatus Package| ### Input Parameters |Field |Data Type | Optional | Description| |----|----|----|----| |clientUUID| String| No| ID for tracking purpose| |request |JSON Object| No|| |airlineCode| String| No| 2-letter IATA airline code – e.g. SQ, MI. In upper case.| |flightNumber| String| No| Up to 4 digits number| |originAirportCode| String| Yes| Must be present with ‘scheduledDepartureDate’.| |scheduledDepartureDate| String| No| Must be present with ‘originAirportCode’ Format: yyyy-MM-dd, could be optional if scheduledArrivalDate is input.| |destinationAirportCode| String| Yes| Must be present with ‘scheduledArrivalDate’.| |scheduledArrivalDate| String| No| Must be present with ‘destinationAirportCode’ Format: yyyy-MM-dd, could be optional if scheduledDepartureDate is input.| ### Output Parameters |Field | Data Type | Description| |----|----|----| |status| String| “SUCCESS” / “FAILED”| |code| Number| 200 if status is “SUCCESS”. Refer to Section 5 for possible error codes| |message| String |error message must be displayed if status is “FAILED”| |clientUUID| String| ClientUUID input from request| |response| JSON Object| empty if status is “FAILED”| |flights|JSON Array|Including all the below info, there would be multiple flights returned if haven’t specified the originAirportCode. (For long haul flight)| |origin| JSON Object|| |airportCode| String| 3-letter IATA code – SIN, LHR. In upper case.| |airportName| String|| |airportTerminal| String|| |cityCode| String| City code of the station| |cityName| String| City name of the station| |destination| JSON Object|| |airportCode| String| 3-letter IATA code – SIN, LHR. In upper case.| |airportName| String|| |airportTerminal| String|| |cityCode| String| City code of the station| |cityName| String| City name of the station| |numberOfStops| Number| 1 numeric| |legs| JSON Array|| |cannedReasonCode| String| Canned message code from IFWS, exist if there is value returned| |flightNumber |String|| |operatingAirlineCode| String| 2-letter IATA code – e.g. SQ, MI.| |operatingAirlineName| String|| |marketingAirlineCode| String| 2-letter IATA code – e.g. LH, VA, VX.| |marketingAirlineName| String|| |flightStatus| String| ‘On schedule’, ‘Arrived’, ‘Delayed’, ‘Cancelled’| |isFlightRenumbered| Boolean| True if flight is renumbered| |isFlightRerouted| Boolean| True if flight is rerouted| |origin| JSON Object| empty for single leg flight| |airportCode| String| 3-letter IATA code – e.g. SIN, LHR.| |airportName| String|| |airportTerminal| String|| |cityCode| String| City code of the station| |cityName| String| City name of the station| |destination| JSON Object| empty for single leg flight| |airportCode| String| 3-letter IATA code – e.g. SIN, LHR.| |airportName| String|| |airportTerminal |String|| |cityCode| String| City code of the station |cityName| String| City name of the station |scheduledDepartureTime| String| W3C date time format: yyyy-MM-ddThh:mm| |scheduledArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |estimatedDepartureTime|String| W3C date time format: yyyy-MM-ddThh:mm| |estimatedArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |actualDepartureTime| String| W3C date time format: yyyy-MM-ddThh:mm| |actualArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |aircraftType| String|| |changedLegs| JSON Array| Present if flight status is Rerouted or Renumbered| |cannedReasonCode| String| Canned message code from IFWS, exist if there is value returned| |flightNumber| String|| |operatingAirlineCode| String| 2-letter IATA code – e.g. SQ, MI.| |operatingAirlineName| String|| |marketingAirlineCode| String| 2-letter IATA code – e.g. LH, VA, VX.| |marketingAirlineName| String|| |flightStatus| String| ‘On schedule’, ‘Arrived’, ‘Delayed’, ‘Cancelled’| |isFlightRenumbered| Boolean| True if flight is renumbered| |isFlightRerouted| Boolean| True if flight is rerouted| |origin| JSON Object| empty for single leg flight| |airportCode| String| 3-letter IATA code – e.g. SIN, LHR.| |airportName| String|| |airportTerminal| String|| |cityCode| String| City code of the station| |cityName| String| City name of the station| |destination| JSON Object| empty for single leg flight| |airportCode| String| 3-letter IATA code – e.g. SIN, LHR.| |airportName| String|| |airportTerminal| String|| |cityCode |String |City code of the station |cityName| String| City name of the station |scheduledDepartureTime| String| W3C date time format: yyyy-MM-ddThh:mm| |scheduledArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |estimatedDepartureTime| String| W3C date time format: yyyy-MM-ddThh:mm| |estimatedArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |actualDepartureTime| String| W3C date time format: yyyy-MM-ddThh:mm| |actualArrivalTime| String| W3C date time format: yyyy-MM-ddThh:mm| |aircraftType| String|| ## Codes References ### Canned Reasons |Reason Code|Description| |----|----| |CN0000001|Weather Conditions| |CN0000002|Airspace Closure| |CN0000003|Airport Closure| |CN0000004|Runway Closure| |CN0000005|Industrial Action| |CN0000006|Late arrival of aircraft (only for ex-station flights)| ## Error Codes ### Generic error codes for API |Code|Type| |----|----| |400| Malformed request.| |401| Not authorised. Client ID not recognized.| |403| Authorised but not allowed to access that API.| |404| API not found.| |410| Version not supported.| |429| Number of requests exceed threshold.| |9xx| Application errors. Refer to individual APIs in Section 4 for applicable codes.| ### Exception codes |Code|Type| |----|----| |FLSTCO9000|Exception occurred while retrieving flight status details| |FLSTCO9101|Database update fail, please contact CSL team.| |FLSTCO9102|Exception occured while retrieving flight date from IFWS JSON, please contact CSL team.| |FLSTCO9103|Flight status/route is not available.| |FLSTCO9104|Exception occured while connecting to Altea service, please contact CSL team.| |FLSTCO0001|Date Format is unparsable. Please use YYYY-MM-DD format.| |FLSTCO0002|Flight Number is not valid.| |FLSTCO0003|Input date is invalid.| |FLSTCO0004|Airport code is not valid.| |FLSTCO0005|Request format is invalid.| |FLSTCO0006|Airline Code is not valid.| |FLSTCO0007|Client ID is required.| |FLSTCO0008|Client UUID is required.| |FLSTCO0009|Origin Airport Code is required.| |FLSTCO0010|Destination Airport Code is required.| |FLSTCO0011|Flight date is required.| |FLSTCO0012|Scheduled Departure Time is required.| |FLSTCO0013|Subscription type is required.| |FLSTCO0014|Subscription value is required.| |FLSTST0001|Input date must be within +/- three date of the current date.| |FLSTST0002|Origin airport code must input together with scheduled departure date.| |FLSTST0003|Destination airport code must input together with scheduled arrival date.| ## JSON Samples ### Input Sample 1 ```json { "request": { "airlineCode": "SQ", "flightNumber": "26", "scheduledDepartureDate": "2017-11-20" }, "clientUUID": "MOB-ClientUUID-123" } ``` ### Output Sample 1 ```json { "status": "SUCCESS", "code": "200", "message": "SUCCESS", "clientUUID": "MOB-ClientUUID-123", "response": { "flights": [ { "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "numberOfStops": 1, "legs": [ { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "On schedule", "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "scheduledDepartureTime": "2017-11-19T23:55", "scheduledArrivalTime": "2017-11-20T06:20" }, { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": true, "flightStatus": "On schedule", "origin": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "destination": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "scheduledDepartureTime": "2017-11-20T08:20", "scheduledArrivalTime": "2017-11-20T11:15" } ], "changedLegs": [ { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "On schedule", "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "scheduledDepartureTime": "2017-11-19T23:55", "scheduledArrivalTime": "2017-11-20T06:20", "aircraftType": "388L" }, { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": true, "flightStatus": "On schedule", "origin": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "destination": { "airportCode": "LAX", "airportName": "Los Angeles Intl", "airportTerminal": "B", "cityCode": "LAX", "cityName": "Los Angeles" }, "scheduledDepartureTime": "2017-11-20T08:20", "scheduledArrivalTime": "2017-11-20T01:00", "estimatedArrivalTime": "2017-11-20T01:00", "aircraftType": "388L" } ] }, { "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "numberOfStops": 2, "legs": [ { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "On schedule", "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "scheduledDepartureTime": "2017-11-20T23:55", "scheduledArrivalTime": "2017-11-21T06:20" }, { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "On schedule", "origin": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "destination": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "scheduledDepartureTime": "2017-11-21T08:20", "scheduledArrivalTime": "2017-11-21T11:15" } ], "changedLegs": [ { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "Arrived", "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "scheduledDepartureTime": "2017-11-20T23:55", "scheduledArrivalTime": "2017-11-21T06:20", "estimatedArrivalTime": "2017-11-21T05:59", "actualDepartureTime": "2017-11-21T00:00", "actualArrivalTime": "2017-11-21T06:00", "aircraftType": "388L" }, { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": false, "flightStatus": "Arrived", "origin": { "airportCode": "FRA", "airportName": "Rhein Main", "airportTerminal": "1", "cityCode": "FRA", "cityName": "Frankfurt" }, "destination": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "scheduledDepartureTime": "2017-11-21T08:20", "scheduledArrivalTime": "2017-11-21T11:15", "estimatedDepartureTime": "2017-11-21T08:45", "estimatedArrivalTime": "2017-11-21T10:16", "actualDepartureTime": "2017-11-21T08:02", "actualArrivalTime": "2017-11-21T02:05", "aircraftType": "388L" }, { "flightNumber": "0026", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": false, "isFlightRerouted": true, "flightStatus": "On schedule", "origin": { "airportCode": "JFK", "airportName": "John F Kennedy Intl", "airportTerminal": "4", "cityCode": "NYC", "cityName": "New York" }, "destination": { "airportCode": "LAX", "airportName": "Los Angeles Intl", "airportTerminal": "B", "cityCode": "LAX", "cityName": "Los Angeles" }, "scheduledDepartureTime": "2017-11-21T13:00", "scheduledArrivalTime": "2017-11-21T13:00", "estimatedDepartureTime": "2017-11-21T13:00", "estimatedArrivalTime": "2017-11-21T13:00", "aircraftType": "388L" } ] } ] } } ``` ### Input Sample 2 ```json { "request": { "airlineCode": "SQ", "flightNumber": "286", "scheduledDepartureDate": "2017-12-07" }, "clientID": "SAA", "apiVersion": 3, "clientUUID": "SAA-ClientUUID-123" } ``` ### Output Sample 2 ```json { "status": "SUCCESS", "code": "200", "message": "SUCCESS", "clientUUID": "SAA-ClientUUID-123", "response": { "flights": [ { "origin": { "airportCode": "AKL", "airportName": "Auckland Intl", "airportTerminal": "I", "cityCode": "AKL", "cityName": "Auckland" }, "destination": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "numberOfStops": 0, "legs": [ { "flightNumber": "0286", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": true, "isFlightRerouted": false, "flightStatus": "Delayed", "origin": { "airportCode": "AKL", "airportName": "Auckland Intl", "airportTerminal": "I", "cityCode": "AKL", "cityName": "Auckland" }, "destination": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "scheduledDepartureTime": "2017-12-07T13:30", "scheduledArrivalTime": "2017-12-07T19:05", "estimatedDepartureTime": "2017-12-07T15:30", "estimatedArrivalTime": "2017-12-07T20:55" } ], "changedLegs": [ { "flightNumber": "9286", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "isFlightRenumbered": true, "isFlightRerouted": false, "flightStatus": "Delayed", "origin": { "airportCode": "AKL", "airportName": "Auckland Intl", "airportTerminal": "I", "cityCode": "AKL", "cityName": "Auckland" }, "destination": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "scheduledDepartureTime": "2017-12-07T13:30", "scheduledArrivalTime": "2017-12-07T19:05", "estimatedDepartureTime": "2017-12-07T15:30", "estimatedArrivalTime": "2017-12-07T21:05", "aircraftType": "388S" } ] } ] } } ``` ### Input Sample 3 ```json { "request": { "airlineCode": "SQ", "flightNumber": "975", "scheduledArrivalDate": "2018-02-22" }, "clientID": "SQCHAT", "apiVersion": 3, "clientUUID": " SQCHAT-ClientUUID-123 " } ``` ### Output Sample 3 ```json { "status": "SUCCESS", "code": "200", "message": "SUCCESS", "clientUUID": " SQCHAT-ClientUUID-123 ", "response": { "flights": [ { "origin": { "airportCode": "BKK", "airportName": "Suvarnabhumi Airport", "cityCode": "BKK", "cityName": "Bangkok" }, "destination": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "numberOfStops": 0, "legs": [ { "flightNumber": "0975", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "flightStatus": "Cancelled", "origin": { "airportCode": "BKK", "airportName": "Suvarnabhumi Airport", "cityCode": "BKK", "cityName": "Bangkok" }, "destination": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "scheduledDepartureTime": "2018-02-22T12:15", "scheduledArrivalTime": "2018-02-22T15:45", "estimatedDepartureTime": "2018-02-22T14:15", "estimatedArrivalTime": "2018-02-22T17:45", "aircraftType": "333", "cannedReasonCode": "CN0000003" } ] }, { "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "AMD", "airportName": "Sardar Vallabhbhai Patel Intl", "airportTerminal": "2", "cityCode": "AMD", "cityName": "Ahmedabad" }, "numberOfStops": 0, "legs": [ { "flightNumber": "0975", "operatingAirlineCode": "SQ", "operatingAirlineName": "Singapore Airlines", "marketingAirlineCode": "SQ", "marketingAirlineName": "Singapore Airlines", "flightStatus": "On schedule", "origin": { "airportCode": "SIN", "airportName": "Changi Intl", "cityCode": "SIN", "cityName": "Singapore" }, "destination": { "airportCode": "AMD", "airportName": "Sardar Vallabhbhai Patel Intl", "airportTerminal": "2", "cityCode": "AMD", "cityName": "Ahmedabad" }, "scheduledDepartureTime": "2018-02-22T16:00", "scheduledArrivalTime": "2018-02-22T20:30" } ] } ] } } ```