Amenities Examples

An Amenities Backwards Compatible endpoint request comprises a request header and two sets of parameters. The request header contains information for partner authentication, API version, and language specification. One set of parameters contains information regarding the particular flight requested, and the other lists the categories to be returned.

Request Header Example

(actual code text is below with explanations as # comments)

Copy
Copied
curl \
    # command-line tool used
"https://<ENDPOINT_URL?ids=IDPARAMETER&include=CATEGORIES>" \
    # this URL includes the host server, the name of the endpoint and the 
    # categories requested (See “Constructing Request URL” below)
-X GET \
    # HTTP method used; should be GET, not POST
-H "x-api-key: <YOUR_API_KEY>" \
    # your unique API key (for subscribed partners who do not yet
    # have an API key, please contact your ATPCO Sales Channel 
    # Retailing manager)
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
    # your access token, obtained within the last 60 minutes from the
    # Access Token API - see the "Authorization" documentation for 
    # more details
-H "Accept: application/vnd.api.v3+json" \
    # current version of the API
-H "Accept-language: <lc>" \
    # the 2-character language code to use (ex. ‘en’ for English)
    # See Language section 3.1.3 for a full list of language codes

Constructing Request URL

Your request URL (shown above as ENDPOINT_URL?ids=IDPARAMETER&include=CATEGORIES) consists of the endpoint URL followed by two query parameters: ids and include.

The ENDPOINT_URL was communicated to you by ATPCO when you registered for the Routehappy API.

IDs

The ids parameter accepts a comma-separated list of flight IDs.

Flight IDs take the format ADC-AAC-CC-F-DEPDATE-C, where the sections are as follows:

  • ADC = Airport Departure Code
  • AAC = Airport Arrival Code
  • CC = Carrier Code
  • F = Flight Number
  • DEPDATE = Departure Date in the format YYYYMMDD
  • C = Cabin Code (ECON, PREMECON, BUSINESS, FIRST)

For example:

Copy
Copied
ids=JFK-LHR-VS-4-20200715-ECON

Categories

The include parameter accepts a comma-separated list of resources, which can include any combination of the categories shown below.

Resource Purpose
segments Structure that contains the relationship of a segment to one or more amenities
segments.aircraft Returns data about the aircraft type
segments.entertainment Returns data regarding on board entertainment options
segments.fresh_food Returns data regarding food service (snacks/meals etc.)
segments.layout Returns data regarding the seat and row layout
segments.power Returns data regarding the different power options
segments.seat Returns data regarding seat type and configuration
segments.wifi Returns data regarding onboard wi-fi access
segments.beverage Returns data regarding beverage service (non-alcoholic/alcoholic) in the requested cabin

For example:

Copy
Copied
include=segments.aircraft,segments.entertainment

Summaries

The include parameter accepts a comma-separated list of resources, which can include any combination of the summaries shown below.

Resource
entertainment_summary
power_summary
wifi_summary
aircraft_summary
layout_summary
fresh_food_summary

For example:

Copy
Copied
include=entertainment_summary,power_summary

Accessing content for all Amenities Categories

To access all Amenities categories' data, list all of the categories within the include parameter.

attention

Click response below to see what this request might return.

requestresponse
Copy
Copied
https://retailing.apis.atpco.net/routehappy/amenities/legs?ids=JFK-LHR-VS-4-20200715-ECON&include=segments.aircraft,segments.entertainment,segments.fresh_food,segments.layout,segments.power,segments.seat,segments.wifi,segments.beverage
Copy
Copied
// Example Response

{
  "data": [
    {
      "id": "JFK-LHR-VS-4-20200715-ECON",
      "links": {
        "segments": [
          "JFK-LHR-VS-4-20200715-ECON"
        ]
      }
    }
  ],
  "linked": {
    "segments": [
      {
        "id": "JFK-LHR-VS-4-20200715-ECON",
        "mk_flt_no": "4",
        "links": {
          "seat": 3,
          "wifi": 338,
          "power": 8,
          "entertainment": 20,
          "fresh_food": 5,
          "beverage": 5,
          "layout": 25,
          "aircraft": 13
        }
      }
    ],
    "seats": [
      {
        "id": 3,
        "display_text": "31\" seat pitch",
        "quality": "standard",
        "legroom": "standard",
        "pitch": "31",
        "width": "standard",
        "flatness": "not flat",
        "type": "standard legroom",
        "updated_at": "2016-07-01T06:09:52Z"
      }
    ],
    "wifis": [
      {
        "id": 338,
        "display_text": "Netflix streaming capable (fee)",
        "quality": "better",
        "performance": "best",
        "cost": "paid",
        "exists": "yes",
        "chance": "full",
        "coverage": "full",
        "connectivity_type": "wifi",
        "type": "wifi",
        "updated_at": "2018-09-19T12:14:03Z"
      }
    ],
    "powers": [
      {
        "id": 8,
        "display_text": "USB outlet",
        "quality": "better",
        "cost": "free",
        "distribution": "all",
        "multiple_at_seat": "no",
        "usb_port": "yes",
        "exists": "yes",
        "power_outlet": "no",
        "chance": "no",
        "type": "usb",
        "updated_at": "2016-05-19T05:01:01Z"
      }
    ],
    "entertainments": [
      {
        "id": 20,
        "display_text": "On demand entertainment",
        "quality": "better",
        "cost": "free",
        "exists": "yes",
        "type": "on-demand",
        "updated_at": "2018-01-17T01:33:46Z",
        "offerings": {
          "delivery_medium": "in-seat",
          "content_type": "avod",
          "selection_type": "on-demand"
        }
      }
    ],
    "fresh_foods": [
      {
        "id": 5,
        "display_text": "Dinner provided",
        "quality": "standard",
        "cost": "free",
        "exists": "yes",
        "type": "meal",
        "updated_at": "2019-01-07T01:32:22Z"
      }
    ],
    "beverages": [
      {
        "id": 5,
        "display_text": "Alcohol & beverages provided",
        "quality": "standard",
        "type": "alcoholic and nonalcoholic",
        "alcoholic_cost": "free",
        "nonalcoholic_cost": "free",
        "exists": "yes",
        "updated_at": "2018-06-04T01:18:03Z"
      }
    ],
    "layouts": [
      {
        "id": 25,
        "display_text": "2-4-2 seat layout",
        "quality": "standard",
        "row_layout": "2-4-2",
        "direct_aisle_access": "no",
        "type": "forward",
        "updated_at": "2016-05-19T05:01:00Z"
      }
    ],
    "aircrafts": [
      {
        "id": 13,
        "display_text": "A330 (widebody)",
        "quality": "standard",
        "model": "A330",
        "type": "widebody",
        "cabin_pressure": "normal",
        "window_size": "standard",
        "updated_at": "2016-05-31T10:00:47Z"
      }
    ]
  },
  "meta": {
    "unmatched_keys": [ 
    ]
  }
}

Accessing content for a single Amenities Category

To access a single Amenities category's data, list only that category your want within the include parameter. In this example, we request only the Wi-Fi category.

attention

Click response below to see what this request might return.

requestresponse
Copy
Copied
https://retailing.apis.atpco.net/routehappy/amenities/legs?ids=JFK-LHR-VS-4-20200715-ECON&include=segments.wifi
Copy
Copied
// Example Response

{
  "data": [
    {
      "id": "JFK-LHR-VS-4-20200715-ECON",
      "links": {
        "segments": [
          "JFK-LHR-VS-4-20200715-ECON"
        ]
      }
    }
  ],
  "linked": {
    "segments": [
      {
        "id": "JFK-LHR-VS-4-20200715-ECON",
        "mk_flt_no": "4",
        "links": {
          "seat": 3,
          "wifi": 338,
          "power": 8,
          "entertainment": 20,
          "fresh_food": 5,
          "beverage": 5,
          "layout": 25,
          "aircraft": 13
        }
      }
    ],
    "wifis": [
      {
        "id": 338,
        "display_text": "Netflix streaming capable (fee)",
        "quality": "better",
        "performance": "best",
        "cost": "paid",
        "exists": "yes",
        "chance": "full",
        "coverage": "full",
        "connectivity_type": "wifi",
        "type": "wifi",
        "updated_at": "2018-09-19T12:14:03Z"
      }
    ]
  },
  "meta": {
    "unmatched_keys": [
    ]
  }
}