Sample 5: Requesting UPAs and related tours

Jaivin Anzalota -

Most UPAs include one or more media items, including photos, videos, and 360° virtual tours and associated captions. Below is an example request and response for requesting UPAs and related 360° virtual tours only.

Request

curl \
"YOUR_HOST/legs_searches?include=legs.leg_fares.leg_fare_segments.upas.tour_attachments.tour" \
-X POST \
-H "Auth: YOUR_API_KEY" \
-H "Content-Type: application/vnd.routehappy+json" \
-H "Accept: application/vnd.routehappy+json" \
-H "Accept-language: en" \
-d '{
  "data": {
    "type": "legs_search",
    "attributes": {
      "legs": [
        {
          "key": "SYD-BNE-VA-905-20180228-BUSINESS"
        }
      ]
    }
  }
}'

Response

{
  "data": {
    "type": "legs_search",
    "id": "bd2c126f-8497-46b3-8507-bf075aba7cb0",
    "relationships": {
      "legs": {
        "data": [
          {
            "type": "leg",
            "id": "1",
            "meta": {
              "index": 0
            }
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "leg",
      "id": "1",
      "relationships": {
        "leg_fares": {
          "data": [
            {
              "type": "leg_fare",
              "id": "1|30"
            }
          ]
        }
      }
    },
    {
      "type": "tour",
      "id": "52",
      "attributes": {
        "image_thumb_url": "https://d2dkkkk22j9rw1.cloudfront.net/tours/a2740a64-e82c-4874-b9eb-3103412a3b9d/square_thumb/png.png?channel_id=zehcbx02",
        "image_medium_square_url": "https://d2dkkkk22j9rw1.cloudfront.net/tours/a2740a64-e82c-4874-b9eb-3103412a3b9d/large_square_thumb/png.png?channel_id=zehcbx02",
        "embed_url": "https://www.google.com/maps/embed?pb=!4v1519003769256!6m8!1m7!1scjLVgZktC8cAAAGuqS_AMQ!2m2!1d-33.93391208247802!2d151.1791383242416!3f200.63!4f-13.170000000000002!5f0.7820865974627469"
      }
    },
    {
      "type": "tour_attachment",
      "id": "78940-52",
      "attributes": {
        "caption": "Explore Sydney Lounge Premium Entry"
      },
      "relationships": {
        "tour": {
          "data": {
            "type": "tour",
            "id": "52"
          }
        }
      }
    },
    {
      "type": "upa",
      "id": "78940",
      "attributes": {
        "headline": "Sydney Lounge Premium Entry",
        "description": "Offering direct kerbside access, optional valet parking, flight check-in and a dedicated security screening point, seven days a week.",
        "small_icon_url": "https://d2dkkkk22j9rw1.cloudfront.net/icons/8a94ee20-bd0e-47a2-ac0f-12b71366685d/small/departure-lounge.png?channel_id=zehcbx02",
        "large_icon_url": "https://d2dkkkk22j9rw1.cloudfront.net/icons/8a94ee20-bd0e-47a2-ac0f-12b71366685d/large/departure-lounge.png?channel_id=zehcbx02",
        "cta_text": "More",
        "cta_url": "https://www.virginaustralia.com/us/en/experience/at-the-airport/sydney-lounge-premium-entry-and-premium-valet/",
        "categories": [
          "departure-lounge"
        ],
        "fees": [

        ]
      },
      "relationships": {
        "tour_attachments": {
          "data": [
            {
              "type": "tour_attachment",
              "id": "78940-52"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare_segment",
      "id": "1|30/0",
      "attributes": {
        "mk_flt_no": "905"
      },
      "relationships": {
        "upas": {
          "data": [
            {
              "type": "upa",
              "id": "78940"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare",
      "id": "1|30",
      "relationships": {
        "leg_fare_segments": {
          "data": [
            {
              "type": "leg_fare_segment",
              "id": "1|30/0"
            }
          ]
        }
      }
    }
  ]
}
…
Have more questions? Submit a request