Keys and References

Within the Universal API schema, many objects contain Key (Key) and Reference (Ref) attributes or elements. In general, these keys and references allow chunks of data to be shared and referenced from other XML elements.

Because the system is designed to use XML object marshalling tools, these concepts allow for objects to cross-reference other objects, when appropriate, much the same as a true object serialization process works. Fundamentally, it prevents duplication of the same data that needs to be referenced from many locations.

See Using Durable Keys for more information.

Key Values

The Key attributes are unique values throughout each XML document so that there is no ambiguity about which object is being identified. These Key values are used to both uniquely identify an element, and also to define the sorting order in certain situations.

If a key is assigned a value starting with a ‘T’, it is considered transient and is reassigned a new value on the response message for that element. All other key values are assigned by the system for all persisted objects.

Key Values in Universal Records

The Key values in a Universal Record (UR) have more caveats than keys in other documents. With one exception, keys returned in a UR retain the same values throughout the life of the reservation. These unique key values make it easy for UR Modification Requests because the element being modified can precisely indicated without specifying an XML element path.

The only time the key values in a UR change is when there is an addition to the middle of an element list. At that point, all the existing keys for that element type are discarded, and all keys get a new value starting from the next available key value. For example, adding a segment to the middle of an itinerary modifies the key values.

Before Segment Insertion

After Segment Insertion

Key

Origin

Destination

Key

Origin

Destination

10

ORD

DEN

14

ORD

DEN

11

DEN

SFO

15

DEN

SFO

12

LAX

DEN

16

SFO

LAX

13

DEN

ORD

17

LAX

DEN

 

 

 

19

DEN

ORD

Ref Values

The various Ref attributes are used to identify an element previously defined in the XML document by specifying its Key value. Each Ref has a name that identifies the type of the element it is referencing. For example: 'AirSegmentRef' or 'FormOfPaymentRef'. There is no attribute named only 'Ref'; all reference attributes have a specific identifier included in the name.