### Example Authorization GET Request Source: https://developer.lufthansa.com/docs/api_flightops/crew_oauth2_server/Authorization_Endpoint An example of a complete GET request to the authorization endpoint, demonstrating the usage of various parameters including PKCE. ```http GET https://oauth-test.lufthansa.com/lhcrew/oauth/authorize?response_type=code &redirect_uri=myApp://callback/ &scope=https://cms.fra.dlh.de/privateCabinApiDev &client_id=123456789012345678901234 &code_challenge=1234567890123456789012345678901234567890123 &code_challenge_method=S256 &state=abc123xyz ``` -------------------------------- ### Example GET Request for Crew Hotel Information Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Crew_Hotel_Information This example demonstrates how to make a GET request to retrieve crew hotel information for a specific station and provider. ```http GET /v1/flight_operations/crew_services/COMMON_CREW_HOTEL_INFO?station=DUB&provider=LHP ``` -------------------------------- ### Example Request for Flight Status by Airport Source: https://developer.lufthansa.com/docs/read/api_details/operations/Flight_Status_by_Airport This example demonstrates how to call the API to get flight statuses for arrivals at FRA airport starting from 2016-12-20T08:00, with a limit of 40 results and an offset of 20. ```http GET /operations/flightstatus/arrivals/FRA/2016-12-20T08:00?limit=40&offset=20 ``` -------------------------------- ### Global Logout Example Request Source: https://developer.lufthansa.com/docs/api_flightops/crew_oauth2_server/Logout_Endpoints An example GET request demonstrating the parameters required for a global logout. The 'userLang' is derived from the client's 'Accept-Language' header. ```http GET https://oauth-test.lufthasa.com/lhcrew/logout?response_type=code &redirect_uri=myApp://callback/ &scope=https://cms.fra.dlh.de/myScope &client_id=123456789012345678901234 &code_challenge=1234567890123456789012345678901234567890123 &code_challenge_method=S256 ``` -------------------------------- ### Simulator Crewlist GET Request Example Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Simulator_Crewlist Example of a GET request to retrieve the simulator crew list for a specific date and with an access code. ```http GET /v1/flight_operations/crew_services/COMMON_SIMULATOR_CREWLIST?forDate=2019-08-07Z&accessCode=4711 ``` -------------------------------- ### Price Offer API Call Examples Source: https://developer.lufthansa.com/docs/read/api_partner/promotions/Price_Offer Examples of GET requests to the Price Offer API for flight searches. Demonstrates different service types and parameter usage. ```http GET /promotions/priceoffers/flights/ond/FRA/ROM?departureDate=2016-10-01&returnDate=2016-10-02&service=amadeusBestPrice ``` ```http GET /promotions/priceoffers/flights/ond/FRA/ROM?departureDate=2016-10-01&returnDate=2016-10-02 ``` -------------------------------- ### Example Global Session Logout Request Source: https://developer.lufthansa.com/docs/read/api_flightops/crew_oauth2_server/Logout_Endpoints An example of a GET request to the logout endpoint, demonstrating the required parameters for a global session invalidation. ```http GET https://oauth-test.lufthansa.com/lhcrew/logout?response_type=code &redirect_uri=myApp://callback/ &scope=https://cms.fra.dlh.de/myScope &client_id=123456789012345678901234 &code_challenge=1234567890123456789012345678901234567890123 &code_challenge_method=S256 ``` -------------------------------- ### Get Crew List Request Example Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Crew_Lists Example of an HTTP GET request to retrieve crew list information for a specific flight. ```http GET /v1/flight_operations/crew_services/COMMON_CREWLIST?flightDesignator=LH400&flightDate=2015-01-01Z&departureAirport=FRA&arrivalAirport=JFK&accessCode=xh5nFs ``` -------------------------------- ### Example Flight Status Request Source: https://developer.lufthansa.com/docs/api_details/operations/Flight_Status An example of a GET request to the Flight Status API for a specific flight and date. ```http GET /operations/flightstatus/LH200/2014-11-01 ``` -------------------------------- ### Check-in Deeplink Request Example Source: https://developer.lufthansa.com/docs/api_partner/customer_deeplinks/Checkin_Deeplinks This example demonstrates the required parameters for generating a check-in deeplink. All specified parameters are mandatory. ```http https://api.lufthansa.com/v2/customer-deeplinks/checkin-links Content-Type: application/x-www-form-urlencoded airlineCode=LX&languageCode=en&lastName=MOYSES&firstName=VALERIE&ticketNumber=2202950268327&departureAirlineCode=LX&departureFlightNumber=1068&departureFlightDate=2018-10-23&departureAirportCode=ZRH ``` -------------------------------- ### Example Seat Map API Calls Source: https://developer.lufthansa.com/docs/read/api_details/offers/Seat_Maps Examples demonstrating how to call the Seat Maps API for different cabin classes. Note that not all cabin classes are available on all flights. ```http GET /offers/seatmaps/LH400/FRA/JFK/2019-07-15/C ``` ```http GET /offers/seatmaps/LH400/FRA/JFK/2019-07-15/F ``` -------------------------------- ### Example API Request using Curl Source: https://developer.lufthansa.com/docs/api_basics/Building_a_Request Demonstrates how to make an authenticated GET request to the Lufthansa API using cURL. Ensure you replace the placeholder token with a valid access token and specify the desired resource. ```curl curl -H "Authorization: Bearer b2d5h7n4chvpun2f4pu7jh36" -H "Accept: application/json" https://api.lufthansa.com/v1/mds-references/airports/FRA ``` -------------------------------- ### City Resource Example (XML) Source: https://developer.lufthansa.com/docs/read/api_details/reference_data/Cities This XML snippet shows the structure of a single city resource, detailing its code, country, names in multiple languages, UTC offset, time zone, and a list of associated airport codes. It includes metadata with links to related resources and alternate travel guide URLs. ```xml NYC US New York Νέα Υόρκη New York Nueva York New York New York ニューヨーク 뉴욕 Nowy Jork Nova Iorque Нью-Йорк New York 紐約 -05:00 America/New_York EWR FLU JFK JRA JRB JRE LGA NBP NES NWS NYS SWF TSS WTC XNY ZME ZRP ZYP ``` -------------------------------- ### Example Request for Customer Flight Information Source: https://developer.lufthansa.com/docs/read/api_details/operations/Customer_Flight_Information_at_Departure_Airport An example of a GET request to retrieve flight information for departures from Frankfurt Airport (FRA) after 8:00 AM on December 20, 2018. ```http GET /operations/customerflightinformation/departures/FRA/2018-12-20T08:00 ``` -------------------------------- ### Example ITCO Request URI Source: https://developer.lufthansa.com/docs/api_partner/customer_deeplinks/Shopping_Links_Confirmation An example of a fully constructed ITCO Request URI with all necessary parameters for generating a shopping link confirmation. ```URL /v2/customer-deeplinks/shopping-links/confirmation?airlineCode=LH&fareCurrency=EUR&returnSegments=LH401&originCode=FRA&fare=1018.34&cabinClass=Economy&countryCode=de&partnerId=13100&encryptionKey=C49A99BBF61C2992A14E60D3F21ABCF&travelDate=2016-10-12&returnDate=2016-11-12&languageCode=de&outboundSegments=LH400&travelers=(adult=3;child=2;infant=1)&partnerName=dummy ``` -------------------------------- ### Curl Request Example for Token Source: https://developer.lufthansa.com/docs/read/api_partner/Getting_a_PARTNER_API_token Example using curl to obtain an API token. Replace placeholders with your actual client ID and secret. ```curl curl "https://api.lufthansa.com/v1/partners/oauth/token" -X POST -d "client_id=28fu8yg7tx35qkqnc6jg96fy" -d "client_secret=6jc9Zj9PE2" -d "grant_type=client_credentials" ``` -------------------------------- ### Aircraft API Request Examples Source: https://developer.lufthansa.com/docs/read/api_details/reference_data/Aircraft Examples demonstrating how to call the Aircraft API. Includes requests for all aircraft, a specific aircraft code, and a paginated request. ```http GET /mds-references/aircraft ``` ```http GET /mds-references/aircraft/70M ``` ```http GET /mds-references/aircraft?limit=44&offset=123 ``` -------------------------------- ### Simulator Crewlist JSON Response Example Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Simulator_Crewlist Example of a successful JSON response containing simulator crewlist data, including event details and crew entries. ```json [ { "forDate": "2019-08-07",     "simulator": "346",     "shift": "3",     "entries": [          {              "crewFunction": "CP",             "simulatorFunction": "CP",             "simulatorActivity": "EI",              "crewName": "CAMERANESI, ALIDA",              "staffIdentifier": "123456A"         },          {              "crewFunction": "CP",             "simulatorFunction": "CP",             "simulatorActivity": "EI",              "crewName": "L, MALTE",              "staffIdentifier": ""         },          {              "crewFunction": "CP",             "simulatorFunction": "CC",             "simulatorActivity": "EI",              "crewName": "S, STEFAN",              "staffIdentifier": ""         },          {              "crewFunction": "SF",             "simulatorFunction": "SF",             "simulatorActivity": "EI",              "crewName": "T, SIGMUND",              "staffIdentifier": ""         }     ],     "errorMessage": null,     "ftNumber": null,     "errorReply": false } ] ``` -------------------------------- ### Origin and Destination Response Example Source: https://developer.lufthansa.com/docs/read/api_partner/offers/OND An example of the XML response for the OND API, illustrating how origin and destination data is presented for a specific carrier. ```APIDOC ## Response Example ```xml ZRH CH FRA DE False False False ``` ``` -------------------------------- ### Access Token Example Source: https://developer.lufthansa.com/docs/api_basics/Building_a_Request Demonstrates how to include a valid access token in the Authorization header for authenticated API requests. ```APIDOC ### Access Token Access to our resources is controlled by authorization tokens. A valid token needs to be sent in the http authorization header with every request. #### Code snippet: Curl ``` curl -H "Authorization: Bearer b2d5h7n4chvpun2f4pu7jh36" -H "Accept: application/json" https://api.lufthansa.com/v1/mds-references/airports/FRA ``` ``` -------------------------------- ### Booking Servicing Deeplinks Request Example Source: https://developer.lufthansa.com/docs/api_partner/customer_deeplinks/Booking_Servicing_Deeplinks This example demonstrates how to construct a POST request to generate booking servicing deeplinks. Ensure all mandatory parameters are included as per the API documentation. ```http POST https://api.lufthansa.com/v2/customer-deeplinks/servicing-links/booking Content-Type: application/x-www-form-urlencoded airlineCode=LH&fileKey=SP5IYX&lastName=Titova&page=BKGD&languageCode=de&countryCode=de ``` -------------------------------- ### Example Request for Airport Weather Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Common_Weather_Service This is an example of a GET request to the Common Weather Service API, specifying 'JFK' as the station code. ```http GET /v1/flight_operations/crew_services/COMMON_AIRPORT_WEATHER?station=JFK ``` -------------------------------- ### Price Offer API Response Example (XML) Source: https://developer.lufthansa.com/docs/read/api_partner/promotions/Price_Offer An example of the XML response structure for a price offer request. Includes details like origin, destination, dates, seat availability, price, and offer type. ```xml FRA FCO 2017-01-13 2016-01-14 7 128.26 EUR BestPrice SA00003-b790715d-b2b8-4d23-ac27-d4e88c0e84af ``` -------------------------------- ### Get Crew Check-In Times Request Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Crew_CheckIn_Times Example GET request to retrieve crew check-in times. Parameters include flight designator, date, and airport information. ```http GET /v1/flight_operations/crew_services/COMMON_CHECK_IN_TIMES ?flightDesignator=LH106&flightDate=2015-10-27Z&departureAirport=FRA&arrivalAirport=MUC&dutyType=OD&nextFlightDesignator=LH401&nextFlightDate=2015-10-27Z&nextArrivalAirport=JFK ``` -------------------------------- ### Curl Example for Obtaining OAuth Token Source: https://developer.lufthansa.com/docs/api_basics/notification_service/Oauth_Token_for_Certificate_Manager_API This curl command demonstrates how to make a POST request to the token endpoint with the necessary parameters. Replace the example client ID and secret with your own. ```curl curl "https://api.lufthansa.com/v1/oauth/token" -X POST -d "client_id=28fu8yg7tx35qkqnc6jg96fy" -d "client_secret=6jc9Zj9PE2" -d "grant_type=client_credentials" ``` -------------------------------- ### Example Flight Departures Status Request Source: https://developer.lufthansa.com/docs/read/api_details/operations/Departures_Status This is an example of a request to get flight departure statuses for Frankfurt Airport (FRA) on December 20, 2016, at 08:00. This request will return passenger flights by default. ```http GET /operations/flightstatus/departures/FRA/2016-12-20T08:00 ``` -------------------------------- ### Get Departures by Airport and Time Source: https://developer.lufthansa.com/docs/read/api_details/operations/Customer_Flight_Information_at_Departure_Airport Retrieve a list of flights departing from a specified airport after a given date and time. You can also control the number of results and the starting offset. ```APIDOC ## GET /operations/customerflightinformation/departures/_{airportCode}/{fromDateTime}_ ### Description Retrieve the status of flights departing from a specific airport after a specified date and time. ### Method GET ### Endpoint /operations/customerflightinformation/departures/_{airportCode}/{fromDateTime}_ ### Parameters #### Path Parameters - **airportCode** (string) - Required - Retrieve the status of flights departing this airport. 3 letter IATA airport code, e.g. “FRA” - **fromDateTime** (string) - Required - Retrieve flights departing after this time. Format: yyyy-MM-ddTHH:mm #### Query Parameters - **limit** (integer) - Optional - The number of items to return (page size). Maximum 100. - **offset** (integer) - Optional - The index of the item with which this result set should begin. ### Request Example #### Code snippet: Call ``` GET /operations/customerflightinformation/departures/FRA/2018-12-20T08:00 ``` ### Response #### Success Response (200) - **Flight Information Response version 3** - See separate documentation for details. ``` -------------------------------- ### Best Fare Search Example (Daily) Source: https://developer.lufthansa.com/docs/api_partner/offers/Best_Fares_New Example of a request to find the best fares per day for a specific route and date range. Ensure all required parameters are correctly formatted. ```http /v1/offers/faresbestprice/bestfares?travel-date=2016-12-29&origin=FRA&cabin-class=Economy&trip-duration=5&country=DE&destination=JNB&range=byday ``` -------------------------------- ### Call Shopping Links Search API Source: https://developer.lufthansa.com/docs/api_partner/customer_deeplinks/Shopping_Links_Search This is an example of a GET request to the Shopping Links Search API. Ensure all parameters are correctly formatted, including dates and traveler counts. ```http /v2/customer-deeplinks/shopping-links/search?airlineCode=LH&originCode=FRA&cabinClass=Economy&countryCode=de&partnerId=13100&encryptionKey=C49A99BBF61C2992A14E60D3F21ABCF&travelDate=2016-10-12&returnDate=2016-11-12&languageCode=de&travelers=(adult=3;child=2;infant=1)&partnerName=dummy ``` -------------------------------- ### Get Common Duty Events Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Duty_Events Retrieves a list of common duty events for crew members between a specified start and end date. The response includes details about each roster day and the events occurring on those days. ```APIDOC ## GET /v1/flight_operations/crew_services/COMMON_DUTY_EVENTS ### Description Retrieves common duty events for crew members within a specified date range. ### Method GET ### Endpoint /v1/flight_operations/crew_services/COMMON_DUTY_EVENTS ### Parameters #### Query Parameters - **fromDate** (string) - Required - The start date for the query (e.g., "2016-10-01Z"). - **toDate** (string) - Required - The end date for the query (e.g., "2016-10-31Z"). ### Response #### Success Response (200) - **pkNumber** (string) - Primary key number for the record. - **fromDate** (string) - The start date of the retrieved duty events. - **toDate** (string) - The end date of the retrieved duty events. - **rosterDays** (array) - An array of objects, where each object represents a roster day and its associated events. - **day** (string) - The date of the roster day. - **events** (array) - An array of event objects occurring on this day. - **eventType** (string) - The type of the event (e.g., "ground", "flight"). - **eventCategory** (string) - The category of the event (e.g., "off", "flight"). - **eventDetails** (string) - Specific details about the event (e.g., flight number). - **wholeDay** (boolean) - Indicates if the event spans the entire day. - **startTime** (string) - The start time of the event. - **startLocation** (string) - The location where the event starts. - **startTimeZoneOffset** (integer) - The time zone offset for the start time. - **endTime** (string) - The end time of the event. - **endLocation** (string) - The location where the event ends. - **endTimeZoneOffset** (integer) - The time zone offset for the end time. - **eventAttributes** (object) - Additional attributes for the event. - **_links** (object) - Links to related resources. ### Response Example ```json { "pkNumber": "123456A", "fromDate": "2016-10-01Z", "toDate": "2016-10-31Z", "rosterDays": [ { "day": "2016-10-01Z", "events": [ { "eventType": "ground", "eventCategory": "off", "eventDetails": "off", "wholeDay": true, "startTime": "2017-02-13T00:00Z", "startLocation": "FRA", "startTimeZoneOffset": 60, "endTime": "2017-02-13T23:59Z", "endLocation": "FRA", "endTimeZoneOffset": 60, "eventAttributes": {}, "_links": {} } ] }, { "day": "2016-10-02Z", "events": [ { "eventType": "flight", "eventCategory": "flight", "eventDetails": "LH400", "wholeDay": false, "startTime": "2017-02-14T12:00Z", "startLocation": "FRA", "startTimeZoneOffset": 60, "endTime": "2016-02-14T23:00Z", "endLocation": "JFK", "endTimeZoneOffset": -300, "eventAttributes": { "rotationId": "123456", "dayOfShift": 1 }, "_links": { "flightInfo": { "href": "./COMMON_FLIGHT_LEG_DETAILS?flightDesignator=LH400&flightDate=2016-10-20Z&departureAirport=FRA&arrivalAirport=JFK" }, "crewList": { "href": "./COMMON_CREWLIST?flightDesignator=LH400&flightDate=2016-10-20Z&departureAirport=FRA&arrivalAirport=JFK&accessCode=n56shdfg3" }, "checkInTimes": { "href": "./COMMON_CHECKIN_TIMES?flightDesignator=LH400&flightDate=02OCT16Z&departureAirport=FRA&arrivalAirport=JFK&..." }, "landingReport": { "href": "./COMMON_LANDING_REPORT?flightDesignator=LH400&flightDate=02OCT16Z&departureAirport=FRA&arrivalAirport=JFK" } } } ] } ] } ``` ``` -------------------------------- ### Multiple City Resources Example (XML) Source: https://developer.lufthansa.com/docs/read/api_details/reference_data/Cities This XML snippet demonstrates the structure for multiple city resources within a single response. Each city entry includes its code, country, names, UTC offset, time zone, and airport codes. ```xml AAA PF Anaa -10:00 Pacific/Tahiti AAA AAB AU Arrabury +10:00 Australia/Brisbane AAB AAC EG El Arish +02:00 Africa/Cairo AAC AAD SO Adado +03:00 Africa/Mogadishu AAD AAE DZ Annaba +01:00 Africa/Algiers AAE AAF US Apalachicola -05:00 ``` -------------------------------- ### Get Customer Flight Information at Arrival Airport Source: https://developer.lufthansa.com/docs/read/api_details/operations/Customer_Flight_Information_at_Arrival_Airport Retrieve the status of all flights arriving at a specific airport within a given time range. The default time range is 4 hours starting from the `fromDateTime` parameter. The permitted range for flights returned is from yesterday until 5 days in the future in 4-hour ranges. At most 80 flights will be returned. ```APIDOC ## GET /operations/customerflightinformation/arrivals/{airportCode}/{fromDateTime} ### Description Retrieve the status of all flights arriving at a specific airport within a given time range which is set to 4 hours by default starting from time value quoted within _fromDateTime_ input parameter. The permitted range for flights returned is from yesterday until 5 days in the future in 4 hours ranges. At most 80 flights will be returned. Various metalinks can be used to switch to _previousRange_ 4 hours period or _nextRange_ 4 hours period. ### Method GET ### Endpoint /operations/customerflightinformation/arrivals/{airportCode}/{fromDateTime} ### Parameters #### Path Parameters - **airportCode** (string) - Required - Retrieve the status of flights arriving at this airport. 3 letter IATA airport code, e.g. “FRA” - **fromDateTime** (string) - Required - Retrieve flights arriving after this time. yyyy-MM-ddTHH:mm #### Query Parameters - **limit** (integer) - Optional - The number of items to return (page size). Max 100. - **offset** (integer) - Optional - The index of the item with which this result set should begin. ### Request Example #### Code snippet: Call ``` GET /operations/customerflightinformation/arrivals/FRA/2018-12-20T08:00?limit=40&offset=20 ``` ### Response #### Success Response (200) - Please see Flight Information Response version 4. ``` -------------------------------- ### XML Fare Response Example Source: https://developer.lufthansa.com/docs/read/api_partner/offers/Fare_Response This XML snippet demonstrates a typical fare response, including offer details, pricing breakdown, and fare component information such as airline, departure/arrival codes, and fare basis. ```xml 1.0.0-db 2016-10-07T10:41:23.697-00:00 Complete 6aa9fb68-1c6e-459e-96df-3ff31a0e6727 1 4U e2ad3a17-808a-4c02-9a63-1d4a5275beac 279.57 0 89.99 89.99 0 84d6ea12-8ec7-4482-a25d-038261afbd35_ADT 4U NUE 2017-05-05-00:00 DUB LX 71.99 71.99 0 84d6ea12-8ec7-4482-a25d-038261afbd35_ADT 697441c1-e425-416e-aacd-9860e9e8e2a1_CHD 4U NUE 2017-05-05-00:00 DUB LX 27.60 27.60 0 84d6ea12-8ec7-4482-a25d-038261afbd35_ADT 697441c1-e425-416e-aacd-9860e9e8e2a1_CHD adb8e6b8-0f5d-4830-b4b4-06603c380f01_INF 4U NUE 2017-05-05-00:00 DUB LX ``` -------------------------------- ### GET Flight Leg Details URL Source: https://developer.lufthansa.com/docs/api_flightops/common_crew_services/Flight_Leg_Details Use this URL to retrieve flight leg details. This is a GET request. ```HTTP GET /v1/flight_operations/crew_services/COMMON_FLIGHT_LEG_DETAILS ``` -------------------------------- ### Best Fare Search Example (Monthly) Source: https://developer.lufthansa.com/docs/api_partner/offers/Best_Fares_New Example of a request to find the best fares per month for a specific route. This allows for broader fare planning over a longer period. ```http /v1/offers/faresbestprice/bestfares?origin=FRA&cabin-class=Business&trip-duration=5&country=DE&destination=JNB&range=bymonth ```