History By Tag or Passenger, or with Passenger Surname

The Bag History service has a query operation which can be used to query a bag. A Bag History service is provided with a mandatory Customer Service API Key, Bag Tag ID and Flight Date, so that BagJourney can provide the Bag Event History based on Bag Tag or Passenger Inputs and basic Airline access restrictions.

The passenger’s surname can also be included to further refine the query.

The Get Bag History operation is a HTTP Get request with bag tag and flight date as mandatory parameters. The response of this operation will be in JSONP format.

GET

Verb URI Description
GET https://bagjourney.sita.aero/baggage/history/
v1.0/tag/{bagtag}/flightdate/{flight_date}
Returns the Bag History for a requested bag tag number anf flight date

Mandatory Query Parameters

Key Value Description Example
bagtag String Bag tag number 01254567890
flight_date String Date of flight 2012-03-11


Request Query Parameters

Parameter Value Mandatory Description Format
api_Key String True The API key to identify the customer Alphanumeric characters (Upper Case Letter [A-Z], Lower Case Letter [a-z] or digit [0-9])
pnr String False Passenger Name Record – PNR provided in the ticket 5 or 6 Alphanumeric characters ((Upper Case Letter [A-Z], Lower Case Letter [a-z] or digit [0-9])
pax_surname String False Surname of the passenger Up to 60 Letters ((Upper Case Letter [A-Z], Lower Case Letter [a-z] or digit [0-9])
include_bim Boolean False Indicator to include Raw BIM message as part of response. Default value is false. True or False


Request Query JSON Response

The request will return a response in the following standard format:

Get Bag History Schema

{  
  "type":"object",
  "description":"Bag History Information",
  "required":true,
  "properties":{  
    "success":{  
      "type":"boolean",
      "required":true,
      "description":"Success"
    },
    "bag":{  
      "type":"object",
      "description":"Common Bag Information",
      "required":false,
      "properties":{  
        "bagtag":{  
          "type":"string",
          "description":"The 10-digit License Plate Number (LPN) of the bag",
          "required":true
        },
        "passenger_first_name":{  
          "type":"string",
          "description":"The first name of the passenger",
          "required":false
        },
        "passenger_last_name":{  
          "type":"string",
          "description":"The surname of the passenger",
          "required":false
        },
        "no_of_checked_bags":{  
          "type":"int",
          "description":"The number of checked-in bags",
          "required":false
        },
        "total_weight_of_checkedin_bags":{  
          "type":"int",
          "description":"The weight of checked-in bags",
          "required":false
        },
        "weight_indicator":{  
          "type":"string",
          "description":"An indicator that specifies the unit of weight",
          "required":false
        }
      }
    },
    "events":{  
      "type":"array",
      "description":"Complete Bag History Event List",
      "required":false,
      "items":{  
        "type":"object",
        "description":"Bag History Event Information",
        "required":false,
        "properties":{  
          "aircraft_compartment":{  
            "type":"string",
            "description":"The Aircraft Compartment Id associated with the loading event",
            "required":false
          },
          "airport":{  
            "type":"string",
            "description":"The IATA Airport Code of the airport where the bag event was recorded",
            "required":true
          },
          "event_code":{  
            "type":"string",
            "description":"The BagJourney event code for the bag event",
            "required":true
          },
          "event_desc":{  
            "type":"string",
            "description":"Brief description of the BagJourney event code",
            "required":true
          },
          "flight_info":{  
            "type":"object",
            "description":"The flight information associated with the event",
            "required":false,
            "properties":{  
              "inbound":{  
                "type":"object",
                "description":"Inbound flight information",
                "required":false,
                "properties":{  
                  "date":{  
                    "type":"string",
                    "description":"Departure Scheduled Date in ISO 8601 standard i.e. YYYY-MM-DD",
                    "required":false
                  },
                  "flight":{  
                    "type":"string",
                    "description":"Flight number including optional operational suffix",
                    "required":false
                  },
                  "airline":{  
                    "type":"string",
                    "description":"IATA Airline code",
                    "required":false
                  },
                  "orig_airport":{  
                    "type":"string",
                    "description":"Origin IATA Airport code",
                    "required":false
                  }
                }
              },
              "onward":{  
                "type":"array",
                "description":"All the Onward Flight Information",
                "required":false,
                "items":{  
                  "type":"object",
                  "description":"Onward Flight Information",
                  "required":false,
                  "properties":{  
                    "date":{  
                      "type":"string",
                      "description":"Departure Scheduled Date in ISO 8601 standard i.e. YYYY-MM-DD",
                      "required":false
                    },
                    "dest_airport":{  
                      "type":"string",
                      "description":"Destination IATA Airport code",
                      "required":false
                    },
                    "flight":{  
                      "type":"string",
                      "description":"Flight number including optional operational suffix",
                      "required":false
                    },
                    "airline":{  
                      "type":"string",
                      "description":"IATA Airline code",
                      "required":false
                    }
                  }
                }
              },
              "outbound":{  
                "type":"object",
                "description":"Outbound Flight Information",
                "required":false,
                "properties":{  
                  "date":{  
                    "type":"string",
                    "description":"Departure Scheduled Date in ISO 8601 standard i.e. YYYY-MM-DD",
                    "required":false
                  },
                  "dest_airport":{  
                    "type":"string",
                    "description":"Destination IATA Airport code",
                    "required":false
                  },
                  "flight":{  
                    "type":"string",
                    "description":"Flight number including optional operational suffix",
                    "required":false
                  },
                  "airline":{  
                    "type":"string",
                    "description":"IATA Airline code",
                    "required":false
                  }
                }
              }
            }
          },
          "flight_loading_info":{  
            "type":"object",
            "description":"The loading flight Information associated with the loading event",
            "required":false,
            "properties":{  
              "dest_airport":{  
                "type":"string",
                "description":"Loading Flight Destination IATA Airport Code",
                "required":false
              },
              "date":{  
                "type":"string",
                "description":"Loading Flight Date in ISO 8601 standard i.e. YYYY-MM-DD",
                "required":false
              },
              "flight":{  
                "type":"string",
                "description":"Loading flight number",
                "required":false
              },
              "airline":{  
                "type":"string",
                "description":"IATA Airline code",
                "required":false
              }
            }
          },
          "connection_flight_info":{  
            "type":"object",
            "description":"The connection flight Information associated with the loaded event",
            "required":false,
            "properties":{  
              "dest_airport":{  
                "type":"string",
                "description":"Connection Flight Destination IATA Airport Code",
                "required":false
              },
              "date":{  
                "type":"string",
                "description":"Connection Flight Date in ISO 8601 standard i.e. YYYY-MM-DD",
                "required":false
              },
              "flight":{  
                "type":"string",
                "description":"Connection flight number",
                "required":false
              },
              "airline":{  
                "type":"string",
                "description":"Connection flight IATA Airline code",
                "required":false
              }
            }
          },
          "reflighted_info":{  
            "type":"object",
            "description":"Re-flighted Information",
            "required":false,
            "properties":{  
              "bagtag":{  
                "type":"string",
                "description":"The 10-digit License Plate Number (LPN) of the bag",
                "required":true
              },
              "flights":{  
                "type":"array",
                "description":"The original Bag Tag Id and original Departure Flight information of the re-flighted bag",
                "required":false,
                "properties":{  
                  "airline":{  
                    "type":"string",
                    "description":"Original departure flight IATA Airline code",
                    "required":false
                  },
                  "flight":{  
                    "type":"string",
                    "description":"Original departure flight number",
                    "required":false
                  },
                  "date":{  
                    "type":"string",
                    "description":"Original departure Flight Date in ISO 8601 standard i.e. YYYY-MM-DD",
                    "required":false
                  }
                }
              }
            }
          },
          "frequent_flyer":{  
            "type":"string",
            "description":"The frequent traveller identifier of the passenger associated with the event",
            "required":false
          },
          "local_date_time":{  
            "type":"string",
            "description":"The date and time local to airport for which BagJourney recorded the bag event in ISO 8601 standard i.e. YYYY-MM-DDTHH24:mm:ss[Z or UTC Offset]",
            "required":true
          },
          "passenger_status":{  
            "type":"string",
            "description":"The PAX Status associated with the event",
            "required":false
          },
          "pnr":{  
            "type":"string",
            "description":"The PNR associated with the event",
            "required":false
          },
          "raw_bim_msg":{  
            "type":"string",
            "description":"The raw BSM message that triggered the event",
            "required":false
          },
          "read_location":{  
            "type":"string",
            "description":"The read location id associated with the event",
            "required":false
          },
          "sent_location":{  
            "type":"string",
            "description":"The Sent To Location Id associated with the event",
            "required":false
          },
          "stowage_device":{  
            "type":"string",
            "description":"The Stowage Device Id associated with the loadeding Flight ",
            "required":false
          },
          "utc_date_time":{  
            "type":"string",
            "description":"The UTC date and time when BagJourney recorded the bag event in ISO 8601 standard i.e. YYYY-MM-DDTHH24:mm:ssZ",
            "required":true
          },
          "unknown_bag_flag":{  
            "type":"string",
            "description":"Returned (as 'Y') only if the bag is an unknown bag created from a BPM",
            "required":false
          },
          "bagtag_status":{  
            "type":"string",
            "description":"The bagtag status associated with the event",
            "required":false
          },
          "longitude":{  
            "type":"string",
            "description":"Longitude information",
            "required":false
          },
          "latitude":{  
            "type":"string",
            "description":"Latitude information",
            "required":false
          },
          "airline_data_set":{  
            "type":"array",
            "description":"Airline data information set",
            "required":false,
            "items":{  
              "properties":{  
                "airline_data":{  
                  "type":"string",
                  "description":"Airline data information",
                  "required":false
                }
              }
            }
          }
        }
      }
    },
    "pax_inquiry_info":{  
      "type":"array",
      "description":"List of flight and blackout information for PaxInquiry data service for each flight leg in the itinerary",
      "required":false,
      "items":{  
        "type":"object",
        "description":"Flight and blackout information for PaxInquiry data service for a flight leg",
        "required":false,
        "flight leg":{  
          "type":"array",
          "description":"List of flight and blackout information for PaxInquiry",
          "required":false,
          "items":{  
            "properties":{  
              "airline":{  
                "type":"string",
                "description":"airline code",
                "required":true
              },
              "flight_no":{  
                "type":"string",
                "description":"flight number",
                "required":true
              },
              "orig_airport":{  
                "type":"string",
                "description":"departure airport code for the flight",
                "required":"true"
              },
              "dept_datetime_local":{  
                "type":"string",
                "description":"departure date and time of the flight",
                "required":"true"
              },
              "dept_datetime_utc":{  
                "type":"string",
                "description":"departure date and time of the flight",
                "required":"true"
              },
              "datetime_type":{  
                "type":"string",
                "description":"departure time indicator to identify Scheduled, Estimated or Actual time",
                "required":"true"
              },
              "paxinquiry_subscription":{  
                "type":"boolean",
                "description":"is the airport and the airline combination configured for the requested service",
                "required":"true"
              },
              "blackout_start_local":{  
                "type":"string",
                "description":"black out date and time",
                "required":"false"
              },
              "blackout_start_utc":{  
                "type":"string",
                "description":"black out date and time",
                "required":"false"
              },
              "arr_datetime_local":{  
                "type":"string",
                "description":"arrival date and time of the flight",
                "required":"true"
              },
              "arr_datetime_utc":{  
                "type":"string",
                "description":"arrival date and time of the flight",
                "required":"true"
              }
            }
          }
        }
      }
    },
    "errors":{  
      "required":false,
      "type":"array",
      "description":"List of Errors",
      "items":{  
        "type":"object",
        "description":"Error",
        "required":false,
        "properties":{  
          "error_code":{  
            "type":"string",
            "description":"Error code of the message",
            "required":true
          },
          "error_description":{  
            "type":"string",
            "description":"Error description corresponding to the Error code",
            "required":true
          }
        }
      }
    }
  }
}


Example Request by Bag Tag and Flight Date, or with Passenger Surname

api_key: 60a9400cd856e08e5ca44f10024a59f4 (This key will be in HTTP header)

Key Example
https://bagjourney.sita.aero/baggage/history/
v1.0/tag/0997435441/flightdate/2013-08-27
Get Bag tag events for tag 0997435441 for August 27, 2013
https://bagjourney.sita.aero/baggage/history/
v1.0/tag/0997435441/flightdate/2013-08-27
Get Bag tag events for tag 0997435441 for August 27, 2013 for passenger surname
?pnr=8HDEW8&pax_surname=SMITH&include_BIM=true 'Smith'


Responses

Sample Response - Success

JSONP


callback(
{
   "success": true,
   "bag": {
      "bagtag": "0997435441",
      "passenger_first_name": "JOHN",
      "passenger_last_name": "SMITH"
      "no_of_checked_bags":"3" ,
       "total_weight_of_checkedin_bags":"33.5",
       "weight_indicator":"K" 

   },
   "events": [
      {
         "airport": "ORD",
         "utc_date_time": "2013-08-27T13:00:00Z",
         "local_date_time": "2013-08-27T13:00:00+01:00",
         "flight_info": {
	"inbound": {
	    "date": "2013-08-27", 
                "airline": "AC",
                "flight": "1800", 
                "orig_airport": "MXP"              
            },
            "outbound": {
	    "date": "2013-08-27", 
                "airline": "BD",
                "flight": "2800", 
                "dest_airport": "LAX"
            },            
             "onward": [
               {
	    "date": "2013-08-28", 
                "airline": "AC",
                "flight": "3324", 
                "dest_airport": "SFO"                 
               }
            ]
         },
       "flight_loading_info": {
            "date": "2013-08-27", 
            "airline": "BD",
            "flight": "1990", 
            "dest_airport": "LAX"
         },
      "connection_flight_info":{
	"dest_airport":"IST",
      	"date":"2013-08-29",
	"flight":"BA",
	"airline":"1232"
        },	
       "reflighted_info":{
	"bagtag":"2125123456",
	"airline":"AI",
	"flight":"2800",
	"date":"2013-08-29",
        },
         "event_code": "EXPECTED",
         "event_desc": "Bag Expected",
         "pnr": "6Y21AS",
         "passenger_status": "C",
         "frequent_flyer": "BXJ2238",        
         "raw_bim_msg": "BSM .V/1TORD .F/BD2800/27AUG/LAX/Y .I/AC1800/27AUG/MXP/Y
        .O/AC3324/28AUG/SFO/Y .N/0997435441001 .S/Y//C/291 .P/2SMITH/JOHNMR/ALICEMRS
        .Y/BXJ2238/GOLD .L/6Y21AS ENDBSM" }, { "airport": "ORD", "utc_date_time": "2013-08-27T13:00:00Z", "local_date_time": "2013-08-27T13:00:00-0400", "event_code": "LOADED_ON_AIRCRAFT", "event_desc": "Bag Loaded on Aircraft", "read_location": "DCQW", "sent_location": "B2", "stowage_device": "AKE12345BD", "aircraft_compartment": "23H", "raw_bim_msg": "BPM .V/1LORD .J/R/45S/381761/27AUG//DCQW/B2 .F/BD1990/27AUG /LAX/Y
        .U/AKE12345BD/23H .N/0997435441001 ENDBPM" } ] } )


Sample Response - Failure
HTTP Code Text Description
400 Bad Request The request is invalid. On violation of not providing mandatory fields or any data kind validation on request parameters except for API Key.


Below is the list of all possible errors the operation can return for HTTP Code 400

JSONP

callback(
  {
     "success": false,
     "errors": [
    {
      "error_code": "BJYGBH001",
      "Multiple bags found, cannot return single bag history"
    },
    {
      "error_code": "BJYGBH002",
      "error_description": "No matching bag found"
    },
    {
      "error_code": "BJYGBH003",
      "error_description": "Customer Service API Key is mandatory"
    },
    {
      "error_code": "BJYGBH004",
      "error_description": "Customer Service API Key does not exist"
    },
    {
      "error_code": "BJYGBH005",
      "error_description": "Bag Tag Id is mandatory"
    },
    {
      "error_code": "BJYGBH006",
      "error_description": "Invalid format, please specify Bag Tag Id as 10-digit numeric LPN,
       e.g. 0125123456" }, { "error_code": "BJYGBH007", "error_description": "Flight Date is mandatory" }, { "error_code": "BJYGBH008", "error_description": "Invalid date, please specify valid Flight Date using YYYY-MM-DD
      format, e.g., 2013-08-26" }, { "error_code": "BJYGBH009", "error_description": "Invalid format, please specify PNR using alphabets [upper case (A-Z)
       or lower case (a-z)] and/or numerals [0-9]" }, { "error_code": "BJYGBH010", "error_description": "PNR length should be 5 or 6 characters" }, { "error_code": "BJYGBH011", "error_description": "Invalid format, please specify PAX Surname using alphabets [upper
       case (A-Z) or lower case (a-z)]" }, { "error_code": "BJYGBH012", "error_description": "PAX Surname exceeds max length of 60" }, { "error_code": "BJYGBH013","error_description": "Include BIM Message should be either
       'true' or 'false'" }, { "error_code": "BJYGBH014", "error_description": "Customer Application not authorized to get this bag history" }, { "error_code": "BJYGBH015", "error_description": "No Customer ID associated with the valid Service API Key provided.
       Contact SITA to complete BagJourney Customer setup" }, { "error_code": "BJYSRV001", "error_description": "System may be currently unavailable, please contact SITA
       Administrator" } ] } )