Handle API Responses and Data
masterEvery API call returns a Response object. Use the following attributes to access the data:
.body: The raw response as a string..result: The response body parsed as JSON (if applicable)..data: The specific data payload (e.g., a list of locations) extracted from the JSON if adatakey is present.
from amadeus import Client, Location
amadeus = Client(client_id='KEY', client_secret='SECRET')
response = amadeus.reference_data.locations.get(keyword='LON', subType=Location.ANY)
print(response.body) # Raw string
print(response.result) # Parsed JSON
print(response.data) # Extracted data payload