Don't see what you need? Submit a request

Sample 3: Requesting UPAs and related photos

Austin Schneider -

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

Request

curl \
  -H "Auth: YOUR_API_KEY" \
  -H "Accept: application/vnd.routehappy+json" \
  -H "Accept-language: en" \
  -G \
  -d "filter[key]=YYC-YYZ-TS-882-20170911-ECON~YYZ-AMS-TS-350-20170911-ECON" \
  -d "include=leg_segments.upas.photo_attachments.photo" \
  "YOUR_HOST/legs"

Response

{
  "data": [
    {
      "type": "leg",
      "id": "3361581-1~3360432-1",
      "attributes": {
        "key": "YYC-YYZ-TS-882-20170911-ECON~YYZ-AMS-TS-350-20170911-ECON"
      },
      "relationships": {
        "leg_segments": {
          "data": [
            {
              "type": "leg_segment",
              "id": "3361581-1~3360432-1/0"
            },
            {
              "type": "leg_segment",
              "id": "3361581-1~3360432-1/1"
            }
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "leg_segment",
      "id": "3361581-1~3360432-1/0",
      "relationships": {
        "upas": {
          "data": [
            {
              "type": "upa",
              "id": "200419"
            },
           …
          ]
        }
      }
    },
    {
      "type": "leg_segment",
      "id": "3361581-1~3360432-1/1",
      "relationships": {
        "upas": {
          "data": [
            {
              "type": "upa",
              "id": "200421"
            },
           …
          ]
        }
      }
    },
    {
      "type": "upa",
      "id": "200415",
      "attributes": {
        "headline": "Our redesigned cabin",
        "description": "With a brand new Economy Class, mood lighting and a personal entertainment system — it’s a whole new inflight experience.",
        "small_icon_url": "http://d13cihc9138cdj.cloudfront.net/icons/a67c9fa7-d915-422f-8eff-e7ba938c566d/small/eco.png",
        "large_icon_url": "http://d13cihc9138cdj.cloudfront.net/icons/a67c9fa7-d915-422f-8eff-e7ba938c566d/large/eco.png",
        "cta_text": "More",
        "cta_url": "http://www.airtransat.ca/en-CA/Travel-information/Our-fleet/Our-redesigned-cabin",
        "categories": [
          "aircraft",
        ],
        "fees": [

        ]
      },
      "relationships": {
        "photo_attachments": {
          "data": [
            {
              "type": "photo_attachment",
              "id": "200415-959"
            }
          ]
        }
      }
    },
    …
     {
      "type": "photo_attachment",
      "id": "200415-959",
      "attributes": {
        "caption": "Our all-new lighting system simulates natural light promoting a more restful flight."
      },
      "relationships": {
        "photo": {
          "data": {
            "type": "photo",
            "id": "959"
          }
        }
      }
    },
…
Have more questions? Submit a request