Don't see what you need? Submit a request

Sample 4: Requesting UPAs and related videos

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 videos only.

Request

curl \
"YOUR_HOST/legs_searches?include=legs.leg_fares.leg_fare_segments.upas.video_attachments.video" \
-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": "YYZ-CDG-TS-188-20181029-BUSINESS"
        }
      ]
    }
  }
}'

Response

{
  "data": {
    "type": "legs_search",
    "id": "9ae84b24-27c6-419e-aab6-322ae7ff5592",
    "relationships": {
      "legs": {
        "data": [
          {
            "type": "leg",
            "id": "1",
            "meta": {
              "index": 0
            }
          }
        ]
      }
    }
  },
  "included": [
    {
      "type": "leg",
      "id": "1",
      "relationships": {
        "leg_fares": {
          "data": [
            {
              "type": "leg_fare",
              "id": "1|120"
            },
            {
              "type": "leg_fare",
              "id": "1|128"
            }
          ]
        }
      }
    },
    {
      "type": "video",
      "id": "99",
      "attributes": {
        "image_thumb_url": "https://d2dkkkk22j9rw1.cloudfront.net/videos/5c66b73b-2e25-470f-95dd-306c20706010/square_thumb/hqdefault.jpg?channel_id=zehcbx02",
        "image_medium_square_url": "https://d2dkkkk22j9rw1.cloudfront.net/videos/5c66b73b-2e25-470f-95dd-306c20706010/large_square_thumb/hqdefault.jpg?channel_id=zehcbx02",
        "embed_url": "//www.youtube.com/embed/fqvEHoNZeuc?controls=0&modestbranding=1&rel=0&showinfo=0"
      }
    },
    {
      "type": "video_attachment",
      "id": "78939-99",
      "attributes": {
        "caption": "Club Class, an inflight experience that offers more comfort and tranquility."
      },
      "relationships": {
        "video": {
          "data": {
            "type": "video",
            "id": "99"
          }
        }
      }
    },
    {
      "type": "upa",
      "id": "78939",
      "attributes": {
        "headline": "Welcome to Club Class",
        "description": "Sit back and relax in an exclusive cabin with spacious and comfortable seats.",
        "small_icon_url": "https://d2dkkkk22j9rw1.cloudfront.net/icons/a4786435-567c-410d-a3d4-4506dd9266c4/small/seat.png?channel_id=zehcbx02",
        "large_icon_url": "https://d2dkkkk22j9rw1.cloudfront.net/icons/a4786435-567c-410d-a3d4-4506dd9266c4/large/seat.png?channel_id=zehcbx02",
        "cta_text": "More",
        "cta_url": "https://www.airtransat.com/en-CA/book/book-a-flight/on-board-comfort/club-class",
        "categories": [
          "seat"
        ],
        "fees": [

        ]
      },
      "relationships": {
        "video_attachments": {
          "data": [
            {
              "type": "video_attachment",
              "id": "78939-99"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare_segment",
      "id": "1|120/0",
      "attributes": {
        "mk_flt_no": "188"
      },
      "relationships": {
        "upas": {
          "data": [
            {
              "type": "upa",
              "id": "78939"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare_segment",
      "id": "1|128/0",
      "attributes": {
        "mk_flt_no": "188"
      },
      "relationships": {
        "upas": {
          "data": [
            {
              "type": "upa",
              "id": "78939"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare",
      "id": "1|120",
      "relationships": {
        "leg_fare_segments": {
          "data": [
            {
              "type": "leg_fare_segment",
              "id": "1|120/0"
            }
          ]
        }
      }
    },
    {
      "type": "leg_fare",
      "id": "1|128",
      "relationships": {
        "leg_fare_segments": {
          "data": [
            {
              "type": "leg_fare_segment",
              "id": "1|128/0"
            }
          ]
        }
      }
    }
  ]
},
…
Have more questions? Submit a request