Galleries

Get a collection

Endpoint
GET /galleries HTTP/1.1

Query string parameters

All query string parameters are optional.

callback string

Wraps the response in a callback function of the given name. Use this parameter to facilitate JSONP requests.

channels comma-separated list of IDs

Return galleries assigned to the given channels.

divisions comma-separated list of IDs

Return galleries assigned to the given divisions.

excluded_ids comma-separated list of IDs

Returns galleries, except those with the given IDs.

has_page boolean

When true, returns galleries that have a dedicated page on the Hub. Some galleries are designed to only be embedded within other content and will not have a dedicated page.

Default value: false

ids comma-separated list of IDs

Return galleries with the given IDs.

order_by comma-separated list

Sort galleries by one or more ORDER_BY and ORDER parameter pairs. Options:

  • ORDER:
    • asc: order from lowest to highest values
    • desc: order from highest to lowest values
  • ORDER_BY:
    • id: order by gallery ID
    • list: order by the order of IDs given in the ids parameter
    • publish_date: order by publish date
    • score: order by popularity

Format: ORDER_BY|ORDER[,ORDER_BY|ORDER,...]

Default value: publish_date|desc,id|asc

page integer

Return galleries from a specific page of a collection.

Default value: 1

per_page integer

Number of galleries to return per page of a collection. Maximum: 100

Default value: 5

source comma-separated list

Return galleries published by the specified source(s).

tags comma-separated list of IDs

Return galleries assigned to the given tags.

topics comma-separated list of IDs

Return galleries assigned to the given topics.

Response

In the example response, embedded galleries are truncated for illustrative purposes. In the real-world version of the response, "...gallery object..." is an entire gallery resource.

The gallery collection
{
   "_embedded": {
      "galleries": [
         "...gallery object...",
         "...gallery object...",
         "...gallery object...",
         "...gallery object...",
         "...gallery object..."
      ]
   },
   "_links": {
      "find": {
         "href": "/galleries/{?id}",
         "templated": true
      },
      "next": {
         "href": "/galleries?page=3"
      },
      "prev": {
         "href": "/galleries?page=1"
      },
      "self": {
         "href": "/galleries?page=2"
      }
   },
   "page": 1,
   "per_page": 5,
   "return_count": 5,
   "total_available": 100
}

Attributes

_embedded hash

Embedded resources.

_embedded.galleries[] array

An array of gallery objects.

page integer

The page number of the returned collection.

per_page integer

The number of galleries requested per page.

return_count integer

Number of galleries returned.

total_available integer

Total number of galleries available in the collection.

Get one

Endpoint
GET /galleries/:id HTTP/1.1

Endpoint parameters

id integer required

The unique identifier of the gallery.

Response

GET /galleries/52645
{
   "_embedded": {
      "divisions": null,
      "image_thumbnail": null,
      "tags": null,
      "topics": null
   },
   "_links": {
      "self": {
         "href": "/galleries/52645"
      }
   },
   "alt_headline": null,
   "author": "Hub staff report",
   "excerpt": "Stormy skies gave way to a beautiful double rainbow over the Milton S. Eisenhower Library on Friday, July 14",
   "headline": "Somewhere under the rainbow",
   "id": 52645,
   "publish_date": 1689605926,
   "short_url": null,
   "slug": "somewhere-under-the-rainbow",
   "teaser_kicker": "Campus close-up",
   "type": "gallery",
   "url": "https://hub.jhu.edu/gallery/2023/07/17/somewhere-under-the-rainbow/"
}

Attributes

_embedded hash

Embedded resources.

_embedded.divisions[] array|null

An array of divisions assigned to the gallery or null if none are assigned.

_embedded.image_thumbnail[] array|null

An array containing the file assigned as the thumbnail image of the gallery or null if not assigned

_embedded.tags[] array|null

An array of tags assigned to the gallery or null if none are assigned.

_embedded.topics[] array|null

An array of topics assigned to the gallery or null if none are assigned.

alt_headline string

A shorter version of the headline, generally displayed alongside the teaser_kicker attribute.

author string

The name of the author.

excerpt string

A short summary of the gallery.

headline string

The title of the gallery.

id integer

Unique identifier of the gallery.

publish_date timestamp

The date of publication as a Unix timestamp in seconds.

short_url deprecated

slug string

The last part of the URL that identifies the resource.

teaser_kicker string

A very short headline that compliments the headline or alternative headline.

type string

Type of resource.

url string|null

Full URL of the gallery. Galleries designed to only be embedded within other content will not have a URL.

Get a subcollection

A subcollection is a collection of objects contained within a gallery.

Endpoint
GET /galleries/:id/:subcollection HTTP/1.1

Endpoint parameters

id integer
The unique identifier of the gallery.
subcollection string

The name of the subcollection to retrieve. Options: channels, divisions, tags, or topics

Query string parameters

To filter the subcollection, see the list of available parameters associated with the chosen subcollection:

Response

See the response associated with the chosen subcollection: