Galleries
Get a collection
GET /galleries HTTP/1.1Query string parameters
All query string parameters are optional.
-
callbackstring -
Wraps the response in a callback function of the given name. Use this parameter to facilitate JSONP requests.
-
channelscomma-separated list of IDs -
Return galleries assigned to the given channels.
-
divisionscomma-separated list of IDs -
Return galleries assigned to the given divisions.
-
excluded_idscomma-separated list of IDs -
Returns galleries, except those with the given IDs.
-
has_pageboolean -
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 -
idscomma-separated list of IDs -
Return galleries with the given IDs.
-
order_bycomma-separated list -
Sort galleries by one or more
ORDER_BYandORDERparameter pairs. Options:Format:
ORDER_BY|ORDER[,ORDER_BY|ORDER,...]Default value:
publish_date|desc,id|asc -
pageinteger -
Return galleries from a specific page of a collection.
Default value:
1 -
per_pageinteger -
Number of galleries to return per page of a collection. Maximum:
100Default value:
5 -
sourcecomma-separated list -
Return galleries published by the specified source(s).
-
tagscomma-separated list of IDs -
Return galleries assigned to the given tags.
-
topicscomma-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.
{
"_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
-
_linkshash -
Links to resources associated with the gallery collection.
-
_links.findlink object -
A templated link that can be used to find a specific resource in the collection.
-
_links.find.hrefstring -
URI of the link.
-
_links.find.templatedboolean -
Identifies the href as a templated URI.
-
_links.nextlink object -
A link to the next set of resources in the collection. If there is not a next page, this link will not be present.
-
_links.next.hrefstring -
URI of the link.
-
_links.prevlink object -
A link to the previous set of resources in the collection. If there is not a previous page, this link will not be present.
-
_links.prev.hrefstring -
URI of the link.
-
_links.selflink object -
A link that identifies the current resource.
-
_links.self.hrefstring -
URI of the link.
-
pageinteger -
The page number of the returned collection.
-
per_pageinteger -
The number of galleries requested per page.
-
return_countinteger -
Number of galleries returned.
-
total_availableinteger -
Total number of galleries available in the collection.
Get one
GET /galleries/:id HTTP/1.1Endpoint parameters
-
idinteger 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": "https://hub.jhu.edu/gallery/2023/07/17/somewhere-under-the-rainbow/",
"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
-
_embeddedhash -
Embedded resources.
-
_embedded.divisions[]array|null -
An array of divisions assigned to the gallery or
nullif none are assigned. -
_embedded.image_thumbnail[]array|null -
An array containing the file assigned as the thumbnail image of the gallery or
nullif not assigned -
_embedded.tags[]array|null -
An array of tags assigned to the gallery or
nullif none are assigned. -
_embedded.topics[]array|null -
An array of topics assigned to the gallery or
nullif none are assigned. -
_linkshash -
Links to resources associated with the gallery.
-
_links.selflink object -
A link that identifies the current resource.
-
_links.self.hrefstring -
URI of the link.
-
alt_headlinestring -
A shorter version of the headline, generally displayed alongside the
teaser_kickerattribute. -
authorstring -
The name of the author.
-
excerptstring -
A short summary of the gallery.
-
headlinestring -
The title of the gallery.
-
idinteger -
Unique identifier of the gallery.
-
publish_datetimestamp -
The date of publication as a Unix timestamp in seconds.
-
short_urldeprecated -
slugstring -
The last part of the URL that identifies the resource.
-
typestring -
Type of resource.
-
urlstring|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.
GET /galleries/:id/:subcollection HTTP/1.1Endpoint parameters
-
idinteger - The unique identifier of the gallery.
-
subcollectionstring -
The name of the subcollection to retrieve. Options:
channels,divisions,tags, ortopics
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: