Using Keys in Universal API Transactions
Universal API uses durable keys, which keeps keys from changing when Universal Records are retrieved and modified.
Request
The existing (optional) Key attribute in a request supports Base 64-encoded Universally Unique Identifier (UUID) values. For example, a Base 64-encoded UUID looks similar to: FRJohOqfS46ERG8efXu5Gw==
IMPORTANT!!
-
Any Key values other than Base 64-encoded UUID are not supported by Travelport Universal API and return an error in the response.
-
The GUID key length must be 24 characters. Keys with greater or fewer than 24 characters are considered general keys, which means Universal API generates a new GUID key for that element and returns the new key in the response. Note that fewer than 22 and greater than 36 characters results in an error.
A value for @Key can be included in a request or is automatically assigned when a PNR is imported. The Key that is sent in the request is returned in the response. If no value is provided in @Key in the request, a UUID is generated in the Universal API response.
Notes:
-
If the Key is not encoded correctly when it is sent in the request, an error is returned. DO NOT change an existing key. Developer references containing information about Base 64 encoding are available on the Internet. Each platform typically provides its own documentation.
-
Many development tools contain functionality to generate a UUID. Please note the special considerations for Base64 encoding UUIDs; it is not simply encoding the String representation. Consult specific platform or language examples on this topic.
The Key remains associated with the element to which it is attached for the life of the Universal Record, and Keys must be unique for each element in a Universal Record (UR). For example, a Key submitted in a request in AirSegment @Key provides a Key value that is consistent and durable for all subsequent requests and responses that reference this AirSegment.
Response
An Element Status (@ElStat) attribute and a Key Override (@KeyOverride) attribute in the response indicate situations where Keys were modified by Universal API, without triggering an error.
- @ElStat is generated with value or 'A' or 'M' or 'C', to indicate state changes in Universal API on the Universal Record.
- ElStat="A": An element was added.
- ElStat="M": An element was modified.
- ElStat="C": A change was detect for an element when a Universal Record was retrieved and synchronized.
- @KeyOverride is returned in the response if a create request was made with a Key value that was not unique in the Universal Record. Check the value of the Key; it was generated by Universal API and changed in the response.