Profile: has-images

Profile Schema

The has-images profile designates a document that contains images. While any document can contain images without the has-images profile, clients looking for images within a document will likely target the images array provided by this profile, so it is highly recommended that a document with images lists a has-images profile.

Structure

has-images specifies one required attribute: images. images is an array of links to images used by this document. The image links in this list may optionally contain rels. Valid rel values for these links are listed below; other values will be rejected:

  • primary - This image should be considered the “featured” image for this document
  • logo - References an image intended to be used as a logo for the content represented by this document
  • premium-logo - References an image intended to be used as a logo for the premium content represented by this document (originally added for NPR+)
  • headshot - Marks an image intended to be used as a headshot photo
  • thumbnail - Marks an image intended to be used as a thumbnail photo
  • promo-image-brick - Indicates this should be the promotional image used for the “brick” crop
  • promo-image-wide - Indicates this should be the promotional image used for the “wide” crop
  • promo-image-square - Indicates this should be the promotional image used for the “square” crop
  • promo-image-standard - Indicates this should be the promotional image used for the “standard” crop

images must contain one or more links; all links must be asset links beginning with #/.

Example has-images document

{
  "id": "12345",
  "profiles": [
    {
      "href": "/v1/profiles/has-images"
    },
    {
      "href": "/v1/profiles/document"
    }
  ],

  "assets": {
    "5678": {
      "id": "5678",
      "profiles": [
        {
          "href": "/v1/profiles/image",
          "rels": [
            "type"
          ]
        }
      ],

      "title": "An AT-AT traverses the forest on Endor",
      "enclosures": [
        {
          "href": "https://npr-media-host.org/images/at-at-endor.jpg",
          "rels": [
            "standard",
            "primary"
          ],
          "type": "image/jpeg",
          "width": 3342,
          "height": 2505
        }
      ]
    },

    "images": [
      {
        "href": "#/assets/5678",
        "rels": [
          "primary",
          "promo-image-standard"
        ]
      }
    ]
  }
}

© 2024 npr