SWA API calls - pthall/SwaCheckin GitHub Wiki

A rough outline of the SWA API requests and responses.

Request Headers

All requests require the key: X-API-KEY
The value is from API-KEY in this static JavaScript.

Retrieve Reservation

Request
Method: GET
URL: https://mobile.southwest.com/api/mobile-air-booking/v1/mobile-air-booking/page/view-reservation/<confirmation>
Query string parameters: first-name last-name

Response
Success

{'viewReservationViewPage': {'_links': {'addCompanion': None,
                                        'cancel': None,
                                        'change': None,
                                        'checkIn': None,
                                        'checkInSessionToken': None,
                                        'earlyBird': None,
                                        'editPNRPassengers': [{'href': '/v1/mobile-air-booking/page/view-reservation/edit-pnr-passenger/ABC123',
                                                               'method': 'GET',
                                                               'query': {'first-name': 'First',
                                                                         'last-name': 'Hall',
                                                                         'passenger-reference': '2'}},
                                                              {'href': '/v1/mobile-air-booking/page/view-reservation/edit-pnr-passenger/ABC123',
                                                               'method': 'GET',
                                                               'query': {'first-name': 'First',
                                                                         'last-name': 'Last',
                                                                         'passenger-reference': '3'}}],
                                        'passportEmergencyContacts': None,
                                        'reaccom': None,
                                        'viewBoardingPassIssuance': None,
                                        'viewBoardingPositions': None,
                                        'viewStandbyList': None},
                             'bounds': [{'arrivalAirport': {'code': 'BNA',
                                                            'country': None,
                                                            'name': 'Nashville',
                                                            'state': 'TN'},
                                         'arrivalStatus': None,
                                         'arrivalStatusType': None,
                                         'arrivalTime': '12:10',
                                         'boundType': 'DEPARTING',
                                         'departureAirport': {'code': 'DSM',
                                                              'country': None,
                                                              'name': 'Des '
                                                                      'Moines',
                                                              'state': 'IA'},
                                         'departureDate': '2019-10-24',
                                         'departureStatus': None,
                                         'departureStatusType': None,
                                         'departureTime': '06:35',
                                         'fareType': 'Anytime',
                                         'flights': [{'aircraftInfo': {'aircraftType': 'Boeing '
                                                                                       '737-700',
                                                                       'numberOfSeats': 143,
                                                                       'wifiSupported': True},
                                                      'number': '2514',
                                                      'wifiOnBoard': True},
                                                     {'aircraftInfo': {'aircraftType': 'Boeing '
                                                                                       '737-700',
                                                                       'numberOfSeats': 143,
                                                                       'wifiSupported': True},
                                                      'number': '969',
                                                      'wifiOnBoard': True}],
                                         'isNextDayArrival': False,
                                         'passengerTypeCounts': {'adult': 2,
                                                                 'senior': 0},
                                         'standbyFlight': None,
                                         'stops': [{'airport': {'code': 'STL',
                                                                'country': None,
                                                                'name': 'St. '
                                                                        'Louis',
                                                                'state': 'MO'},
                                                    'arrivalStatus': None,
                                                    'arrivalStatusType': None,
                                                    'arrivalTime': '07:35',
                                                    'changePlanes': True,
                                                    'departureStatus': None,
                                                    'departureStatusType': None,
                                                    'departureTime': '08:30',
                                                    'missingAirportDetails': False},
                                                   {'airport': {'code': 'DTW',
                                                                'country': None,
                                                                'name': 'Detroit',
                                                                'state': 'MI'},
                                                    'arrivalStatus': None,
                                                    'arrivalStatusType': None,
                                                    'arrivalTime': '11:00',
                                                    'changePlanes': False,
                                                    'departureStatus': None,
                                                    'departureStatusType': None,
                                                    'departureTime': '11:35',
                                                    'missingAirportDetails': False}],
                                         'travelTime': '5h 35m'},
                                        {'arrivalAirport': {'code': 'DSM',
                                                            'country': None,
                                                            'name': 'Des '
                                                                    'Moines',
                                                            'state': 'IA'},
                                         'arrivalStatus': None,
                                         'arrivalStatusType': None,
                                         'arrivalTime': '12:50',
                                         'boundType': 'RETURNING',
                                         'departureAirport': {'code': 'BNA',
                                                              'country': None,
                                                              'name': 'Nashville',
                                                              'state': 'TN'},
                                         'departureDate': '2019-11-06',
                                         'departureStatus': None,
                                         'departureStatusType': None,
                                         'departureTime': '07:35',
                                         'fareType': 'Anytime',
                                         'flights': [{'aircraftInfo': {'aircraftType': 'Boeing '
                                                                                       '737-700',
                                                                       'numberOfSeats': 143,
                                                                       'wifiSupported': True},
                                                      'number': '2011',
                                                      'wifiOnBoard': True},
                                                     {'aircraftInfo': {'aircraftType': 'Boeing '
                                                                                       '737-700',
                                                                       'numberOfSeats': 143,
                                                                       'wifiSupported': True},
                                                      'number': '1982',
                                                      'wifiOnBoard': True}],
                                         'isNextDayArrival': False,
                                         'passengerTypeCounts': {'adult': 2,
                                                                 'senior': 0},
                                         'standbyFlight': None,
                                         'stops': [{'airport': {'code': 'STL',
                                                                'country': None,
                                                                'name': 'St. '
                                                                        'Louis',
                                                                'state': 'MO'},
                                                    'arrivalStatus': None,
                                                    'arrivalStatusType': None,
                                                    'arrivalTime': '08:50',
                                                    'changePlanes': True,
                                                    'departureStatus': None,
                                                    'departureStatusType': None,
                                                    'departureTime': '11:40',
                                                    'missingAirportDetails': False}],
                                         'travelTime': '5h 15m'}],
                             'checkInIneligibilityReason': None,
                             'companion': None,
                             'confirmationNumber': 'ABC123',
                             'dates': {'first': '2019-10-24',
                                       'second': '2019-11-06'},
                             'destinationAirport': {'code': 'BNA',
                                                    'country': None,
                                                    'name': 'Nashville',
                                                    'state': 'TN'},
                             'destinationDescription': 'Nashville',
                             'greyBoxMessage': None,
                             'greyBoxPassengerMessage': None,
                             'hasAnyCancelledFlights': False,
                             'hasUnaccompaniedMinor': False,
                             'isCheckInEligible': False,
                             'isCheckedIn': False,
                             'isDynamicWaiver': False,
                             'isInternational': False,
                             'isNonRevPnr': False,
                             'isSwabiz': False,
                             'messages': None,
                             'originAirport': {'code': 'DSM',
                                               'country': None,
                                               'name': 'Des Moines',
                                               'state': 'IA'},
                             'pageHeader': 'DSM - BNA',
                             'passengers': [{'accountNumber': '012345678',
                                             'checkInIneligibilityReason': None,
                                             'hasAnyEarlyBird': False,
                                             'hasCompletePassportInfo': False,
                                             'isCheckInEligible': False,
                                             'isCheckedIn': False,
                                             'isUnaccompaniedMinor': False,
                                             'name': 'First Last',
                                             'passengerReference': '2'},
                                            {'accountNumber': None,
                                             'checkInIneligibilityReason': None,
                                             'hasAnyEarlyBird': False,
                                             'hasCompletePassportInfo': False,
                                             'isCheckInEligible': False,
                                             'isCheckedIn': False,
                                             'isUnaccompaniedMinor': False,
                                             'name': 'First Last',
                                             'passengerReference': '3'}],
                             'shareDetails': {'confirmationInfo': 'Confirmation '
                                                                  '#: ABC123',
                                              'flightInfo': [{'arrivalDateTime': '2019-10-24T12:10:00.000-05:00',
                                                              'arrivalInfo': 'Arrives: '
                                                                             '12:10 '
                                                                             'PM '
                                                                             'BNA',
                                                              'departureDateTime': '2019-10-24T06:35:00.000-05:00',
                                                              'departureInfo': 'Departs: '
                                                                               '06:35 '
                                                                               'AM '
                                                                               'DSM',
                                                              'flightInfo': 'Flight '
                                                                            '#: '
                                                                            '2514/969',
                                                              'header': 'Departing '
                                                                        'Flight: '
                                                                        'Thu, '
                                                                        'Oct '
                                                                        '24, '
                                                                        '2019',
                                                              'stops': ['Stop: '
                                                                        'St. '
                                                                        'Louis, '
                                                                        'MO. '
                                                                        'Change '
                                                                        'planes',
                                                                        'Stop: '
                                                                        'Detroit, '
                                                                        'MI. '
                                                                        'No '
                                                                        'plane '
                                                                        'change'],
                                                              'title': 'Southwest '
                                                                       'Flight '
                                                                       '2514/969 '
                                                                       'Des '
                                                                       'Moines '
                                                                       'to '
                                                                       'Nashville',
                                                              'travelTime': 'Travel '
                                                                            'time: '
                                                                            '5hr '
                                                                            '35 '
                                                                            'mins'},
                                                             {'arrivalDateTime': '2019-11-06T12:50:00.000-06:00',
                                                              'arrivalInfo': 'Arrives: '
                                                                             '12:50 '
                                                                             'PM '
                                                                             'DSM',
                                                              'departureDateTime': '2019-11-06T07:35:00.000-06:00',
                                                              'departureInfo': 'Departs: '
                                                                               '07:35 '
                                                                               'AM '
                                                                               'BNA',
                                                              'flightInfo': 'Flight '
                                                                            '#: '
                                                                            '2011/1982',
                                                              'header': 'Returning '
                                                                        'Flight: '
                                                                        'Wed, '
                                                                        'Nov '
                                                                        '06, '
                                                                        '2019',
                                                              'stops': ['Stop: '
                                                                        'St. '
                                                                        'Louis, '
                                                                        'MO. '
                                                                        'Change '
                                                                        'planes'],
                                                              'title': 'Southwest '
                                                                       'Flight '
                                                                       '2011/1982 '
                                                                       'Nashville '
                                                                       'to Des '
                                                                       'Moines',
                                                              'travelTime': 'Travel '
                                                                            'time: '
                                                                            '5hr '
                                                                            '15 '
                                                                            'mins'}],
                                              'passengerInfo': 'Passenger '
                                                               'names: First '
                                                               'Last, First '
                                                               'Last',
                                              'subject': 'Southwest Flight '
                                                         '2514 Des Moines to '
                                                         'Nashville'},
                             'shouldShowAddEarlyBirdButton': False}}

Error

{'code': 400620389,
 'header': None,
 'httpStatusCode': 'BAD_REQUEST',
 'infoList': [{'key': 'AIS category: DATA',
               'value': 'Error:202 - Reservation not found'},
              {'key': 'AIS detail: source', 'value': 'Altea'},
              {'key': 'AIS detail: service', 'value': 'PNR_Retrieve'},
              {'key': 'AIS detail: version', 'value': '17_1'},
              {'key': 'AIS detail: code', 'value': '1929'},
              {'key': 'AIS detail: message', 'value': 'INVALID RECORD LOCATOR'},
              {'key': 'recordLocator', 'value': 'ABCI23'}],
 'message': 'Reservation could not be retrieved (i.e. record locator not found '
            'or invalid)',
 'messageKey': 'ERROR__AIR_RESERVATION__RECORD_LOCATOR_NOT_FOUND',
 'requestId': 'no-exp-id:made1up2guid3:unknown'}

Retrieve Check-in Data

Request
Method: GET
URL: https://mobile.southwest.com/api/mobile-air-operations/v1/mobile-air-operations/page/check-in/<confirmation>
Query string parameters: first-name last-name

Response
Success

{'checkInSessionToken': 'absolutely_giant_token',
 'checkInViewReservationPage': {'_links': {'checkIn': {'body': {'checkInSessionToken': 'absolutely_giant_token',
                                                                'firstName': 'First',
                                                                'lastName': 'Last',
                                                                'recordLocator': 'ABC123'},
                                                       'href': '/v1/mobile-air-operations/page/check-in',
                                                       'method': 'POST'},
                                           'travelDocuments': None},
                                'cards': [{'arrivalAirport': 'BNA',
                                           'arrivalTime': '12:10',
                                           'dates': {'first': '2019-10-24',
                                                     'second': None},
                                           'departureAirport': 'DSM',
                                           'departureDate': '2019-10-24',
                                           'departureTime': '06:35',
                                           'destinationDescription': 'Nashville',
                                           'flights': [{'departureDate': 'Oct '
                                                                         '24',
                                                        'departureGate': 'A3',
                                                        'departureTime': '06:35',
                                                        'destinationAirportCode': 'STL',
                                                        'destinationStationName': 'St. '
                                                                                  'Louis',
                                                        'flightNumber': '2514',
                                                        'hasWifi': True,
                                                        'originAirportCode': 'DSM'},
                                                       {'departureDate': 'Oct '
                                                                         '24',
                                                        'departureGate': 'E8',
                                                        'departureTime': '08:30',
                                                        'destinationAirportCode': 'BNA',
                                                        'destinationStationName': 'Nashville',
                                                        'flightNumber': '969',
                                                        'hasWifi': True,
                                                        'originAirportCode': 'STL'}],
                                           'hazmatCheckInDisclaimer': 'By '
                                                                      'tapping '
                                                                      "'Check "
                                                                      "in' you "
                                                                      'acknowledge '
                                                                      'that '
                                                                      'you '
                                                                      'understand '
                                                                      'the '
                                                                      'hazardous '
                                                                      'materials '
                                                                      'restrictions '
                                                                      'and '
                                                                      'penalties.',
                                           'travelTime': '5h 35m'}],
                                'hazmatText': 'Federal law forbids the '
                                              'carriage of hazardous materials '
                                              'such as aerosols, fireworks, '
                                              'lithium batteries and flammable '
                                              'liquids aboard the aircraft in '
                                              'your checked or carryon '
                                              'baggage. E-cigarettes are not '
                                              'permitted in checked baggage '
                                              'and must be transported in '
                                              'carryon baggage only.',
                                'pnr': {'confirmationNumber': 'ABC123',
                                        'passengers': ['First Last',
                                                       'First Last']}},
 'prefillPassengerAPISDocuments': None}

Error

{'code': 404611301,
 'header': None,
 'httpStatusCode': 'NOT_FOUND',
 'infoList': [],
 'message': "We can't find this reservation. Please double-check your "
            'information',
 'messageKey': 'ERROR__AIR_TRAVEL__RESERVATION_NOT_FOUND',
 'requestId': 'no-exp-id:made1up2guid3:unknown'}

Check-in Reservation

Request
Method: POST
URL: https://mobile.southwest.com/api/mobile-air-operations/v1/mobile-air-operations/page/check-in/
Request body:

{'firstName': 'first_name',
 'lastName': 'last_name',
 'recordLocator': 'confirmation',
 'checkInSessionToken': 'checkin_token'}

Response

'checkInConfirmationPage': {'_links': None,
                             'flights': [{'boundIndex': 0,
                                          'departureTime': '06:35',
                                          'destinationAirportCode': 'STL',
                                          'flightNumber': '2514',
                                          'gate': 'A3',
                                          'hasWifi': True,
                                          'originAirportCode': 'DSM',
                                          'passengers': [{'_links': {'viewPassengerBoardingPass': None},
                                                          'boardingGroup': 'B',
                                                          'boardingPosition': '32',
                                                          'checkedIn': True,
                                                          'confirmationNumber': 'ABC123',
                                                          'greyBoxMessage': {'body': 'Passengers '
                                                                                     'can '
                                                                                     'log '
                                                                                     'in '
                                                                                     'to '
                                                                                     'their '
                                                                                     'account '
                                                                                     'to '
                                                                                     'view '
                                                                                     'their '
                                                                                     'own '
                                                                                     'mobile '
                                                                                     'boarding '
                                                                                     'pass.',
                                                                             'header': None,
                                                                             'key': 'GREY_BOX_UNAVAILABLE_MULTIPAX_NO_MBP'},
                                                          'hasPrecheck': True,
                                                          'mobileBoardingPassEligible': False,
                                                          'mobileBoardingPassIneligibilityErrorCode': 'MBP_UNAVAILABLE_USE_OTHER_SELF_SERVICE',
                                                          'name': 'First Last',
                                                          'specialAssistanceMessage': None,
                                                          'travelerID': '012ID',
                                                          'travelerSegmentIdentifier': '012ID'},
                                                         {'_links': {'viewPassengerBoardingPass': None},
                                                          'boardingGroup': 'B',
                                                          'boardingPosition': '33',
                                                          'checkedIn': True,
                                                          'confirmationNumber': 'ABC123',
                                                          'greyBoxMessage': {'body': 'Passengers '
                                                                                     'can '
                                                                                     'log '
                                                                                     'in '
                                                                                     'to '
                                                                                     'their '
                                                                                     'account '
                                                                                     'to '
                                                                                     'view '
                                                                                     'their '
                                                                                     'own '
                                                                                     'mobile '
                                                                                     'boarding '
                                                                                     'pass.',
                                                                             'header': None,
                                                                             'key': 'GREY_BOX_UNAVAILABLE_MULTIPAX_NO_MBP'},
                                                          'hasPrecheck': True,
                                                          'mobileBoardingPassEligible': False,
                                                          'mobileBoardingPassIneligibilityErrorCode': 'MBP_UNAVAILABLE_USE_OTHER_SELF_SERVICE',
                                                          'name': 'First '
                                                                  'Last',
                                                          'specialAssistanceMessage': None,
                                                          'travelerID': '012ID',
                                                          'travelerSegmentIdentifier': '012ID'}],
                                          'segmentType': 'DEPARTING',
                                          'travelTime': '1h 0m'},
                                         {'boundIndex': 0,
                                          'departureTime': '08:30',
                                          'destinationAirportCode': 'BNA',
                                          'flightNumber': '969',
                                          'gate': 'E8',
                                          'hasWifi': True,
                                          'originAirportCode': 'STL',
                                          'passengers': [{'_links': {'viewPassengerBoardingPass': None},
                                                          'boardingGroup': 'B',
                                                          'boardingPosition': '21',
                                                          'checkedIn': True,
                                                          'confirmationNumber': 'ABC123',
                                                          'greyBoxMessage': {'body': 'Passengers '
                                                                                     'can '
                                                                                     'log '
                                                                                     'in '
                                                                                     'to '
                                                                                     'their '
                                                                                     'account '
                                                                                     'to '
                                                                                     'view '
                                                                                     'their '
                                                                                     'own '
                                                                                     'mobile '
                                                                                     'boarding '
                                                                                     'pass.',
                                                                             'header': None,
                                                                             'key': 'GREY_BOX_UNAVAILABLE_MULTIPAX_NO_MBP'},
                                                          'hasPrecheck': True,
                                                          'mobileBoardingPassEligible': False,
                                                          'mobileBoardingPassIneligibilityErrorCode': 'MBP_UNAVAILABLE_USE_OTHER_SELF_SERVICE',
                                                          'name': 'First Last',
                                                          'specialAssistanceMessage': None,
                                                          'travelerID': '012ID',
                                                          'travelerSegmentIdentifier': '012ID'},
                                                         {'_links': {'viewPassengerBoardingPass': None},
                                                          'boardingGroup': 'B',
                                                          'boardingPosition': '22',
                                                          'checkedIn': True,
                                                          'confirmationNumber': 'ABC123',
                                                          'greyBoxMessage': {'body': 'Passengers '
                                                                                     'can '
                                                                                     'log '
                                                                                     'in '
                                                                                     'to '
                                                                                     'their '
                                                                                     'account '
                                                                                     'to '
                                                                                     'view '
                                                                                     'their '
                                                                                     'own '
                                                                                     'mobile '
                                                                                     'boarding '
                                                                                     'pass.',
                                                                             'header': None,
                                                                             'key': 'GREY_BOX_UNAVAILABLE_MULTIPAX_NO_MBP'},
                                                          'hasPrecheck': True,
                                                          'mobileBoardingPassEligible': False,
                                                          'mobileBoardingPassIneligibilityErrorCode': 'MBP_UNAVAILABLE_USE_OTHER_SELF_SERVICE',
                                                          'name': 'First '
                                                                  'Last',
                                                          'specialAssistanceMessage': None,
                                                          'travelerID': '012ID',
                                                          'travelerSegmentIdentifier': '012ID'}],
                                          'segmentType': 'CHANGE_PLANES',
                                          'travelTime': '3h 40m'}],
                             'messages': None,
                             'title': {'body': "You're checked in!",
                                       'icon': 'SUCCESS',
                                       'key': 'CHECKIN__YOURE_CHECKEDIN',
                                       'textColor': 'NORMAL'}}}

Retrieve Boarding Pass(es)

Request
Method: POST
URL: https://mobile.southwest.com/api/mobile-air-operations/v1/mobile-air-operations/page/check-in/retrieve-boarding-pass/<confirmation>
Request body:

{'firstName': 'first_name',
 'lastName': 'last_name',
 'recordLocator': 'confirmation',
 'travelerID': 'traveler_id'}

Response

{'checkInRetrieveBoardingPassPage': {'mobileBoardingPassInfo': None,
                                     'mobileBoardingPassViewPage': {'messages': None,
                                                                    'mobileBoardingPassView': [{'adaptiveLink': 'https://wallet-api.urbanairship.com/v1/pass/adaptive/garb4ge1d',
                                                                                                'barcodeString': 'QRCodeString',
                                                                                                'boardingGroup': 'B',
                                                                                                'boardingPassSSRs': None,
                                                                                                'boardingPosition': '32',
                                                                                                'boardingTime': '06:05',
                                                                                                'confirmationNumber': 'ABC123',
                                                                                                'departureDate': '2019-10-24',
                                                                                                'departureGate': 'A3',
                                                                                                'departureTime': '06:35',
                                                                                                'destinationAirportCode': 'STL',
                                                                                                'destinationAirportDescription': 'St. '
                                                                                                                                 'Louis, '
                                                                                                                                 'MO '
                                                                                                                                 '- '
                                                                                                                                 'STL',
                                                                                                'eligibleForDrinkCoupon': False,
                                                                                                'fareType': 'Anytime',
                                                                                                'flightNumber': '2514',
                                                                                                'hasExtraSeat': False,
                                                                                                'hasTsaPreCheck': True,
                                                                                                'isInfant': False,
                                                                                                'isYoungTraveler': False,
                                                                                                'originAirportCode': 'DSM',
                                                                                                'originAirportDescription': 'Des '
                                                                                                                            'Moines, '
                                                                                                                            'IA '
                                                                                                                            '- '
                                                                                                                            'DSM',
                                                                                                'passenger': {'accountNumber': '0123456',
                                                                                                              'name': {'firstName': 'First',
                                                                                                                       'lastName': 'Last',
                                                                                                                       'middleName': None},
                                                                                                              'rrTier': 'NONE',
                                                                                                              'rrTierDescription': '--',
                                                                                                              'travelerId': '012ID'},
                                                                                                'travelerSegmentIdentifier': '012ID'},
                                                                                               {'adaptiveLink': 'https://wallet-api.urbanairship.com/v1/pass/adaptive/garb4ge1d',
                                                                                                'barcodeString': 'QRCodeString',
                                                                                                'boardingGroup': 'B',
                                                                                                'boardingPassSSRs': None,
                                                                                                'boardingPosition': '21',
                                                                                                'boardingTime': '08:00',
                                                                                                'confirmationNumber': 'ABC123',
                                                                                                'departureDate': '2019-10-24',
                                                                                                'departureGate': 'E8',
                                                                                                'departureTime': '08:30',
                                                                                                'destinationAirportCode': 'BNA',
                                                                                                'destinationAirportDescription': 'Nashville, '
                                                                                                                                 'TN '
                                                                                                                                 '- '
                                                                                                                                 'BNA',
                                                                                                'eligibleForDrinkCoupon': False,
                                                                                                'fareType': 'Anytime',
                                                                                                'flightNumber': '969',
                                                                                                'hasExtraSeat': False,
                                                                                                'hasTsaPreCheck': True,
                                                                                                'isInfant': False,
                                                                                                'isYoungTraveler': False,
                                                                                                'originAirportCode': 'STL',
                                                                                                'originAirportDescription': 'St. '
                                                                                                                            'Louis, '
                                                                                                                            'MO '
                                                                                                                            '- '
                                                                                                                            'STL',
                                                                                                'passenger': {'accountNumber': '0123456',
                                                                                                              'name': {'firstName': 'First',
                                                                                                                       'lastName': 'Last',
                                                                                                                       'middleName': None},
                                                                                                              'rrTier': 'NONE',
                                                                                                              'rrTierDescription': '--',
                                                                                                              'travelerId': '012ID'},
                                                                                                'travelerSegmentIdentifier': '012ID'}]}}}