Channels
Hierarchical taxonomy used to create custom feeds of content.
Get a collection
GET /channels 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.
-
excluded_idscomma-separated list of IDs -
Returns channels, except those with the given IDs.
-
idscomma-separated list of IDs -
Return channels with the given IDs.
-
order_bycomma-separated list -
Sort channels by one or more
ORDER_BYandORDERparameter pairs. Options:Format:
ORDER_BY|ORDER[,ORDER_BY|ORDER,...]Default value:
name|asc -
pageinteger -
Return channels from a specific page of a collection.
Default value:
1 -
per_pageinteger -
Number of channels to return per page of a collection. Maximum:
100Default value:
5 -
slugcomma-separated list -
Return channels matching the given slug(s).
Response
In the example response, embedded channels are truncated for illustrative purposes. In the real-world version of the response, "...channel object..." is an entire channel resource.
{
"_embedded": {
"channels": [
"...channel object...",
"...channel object...",
"...channel object...",
"...channel object...",
"...channel object..."
]
},
"_links": {
"find": {
"href": "/channels/{?id}",
"templated": true
},
"next": {
"href": "/channels?page=3"
},
"prev": {
"href": "/channels?page=1"
},
"self": {
"href": "/channels?page=2"
}
},
"page": 1,
"per_page": 5,
"return_count": 5,
"total_available": 100
}Attributes
-
_linkshash -
Links to resources associated with the channel 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 channels requested per page.
-
return_countinteger -
Number of channels returned.
-
total_availableinteger -
Total number of channels available in the collection.
Get one
GET /channels/:id HTTP/1.1Endpoint parameters
-
idinteger required -
The unique identifier of the channel.
Response
GET /channels/4765
{
"_embedded": {},
"_links": {
"self": {
"href": "/channels/4765"
}
},
"id": 4765,
"name": "555-penn",
"parent": null,
"slug": "555-penn",
"type": "channel",
"url": {
"articles": "https://hub.jhu.edu/channels/555-penn/articles/",
"events": "https://hub.jhu.edu/channels/555-penn/events/"
}
}Attributes
-
_embeddedhash -
Embedded resources.
-
_linkshash -
Links to resources associated with the channel.
-
_links.selflink object -
A link that identifies the current resource.
-
_links.self.hrefstring -
URI of the link.
-
idinteger -
Unique identifier of the channel.
-
namestring -
The nice name of the channel.
-
parenthash|null -
The parent channel, if there is one.
-
parent.idinteger -
Unique identifier of the parent channel.
-
parent.namestring -
The nice name of the parent channel.
-
parent.slugstring -
The name of the parent channel used in URLs.
-
slugstring -
The name of the channel used in URLs.
-
typestring -
Type of resource.
-
urlhash -
URLs that point to collections of content in this channel on the Hub website.
-
url.articlesstring -
Points to the collection of articles in this channel on the Hub.
-
url.eventsstring -
Points to the collection of events in this channel on the Hub.
Get a subcollection
A subcollection is a collection of objects contained within a channel.
GET /channels/:id/:subcollection HTTP/1.1Endpoint parameters
-
idinteger - The unique identifier of the channel.
-
subcollectionstring -
The name of the subcollection to retrieve. Options:
articles,events, orpeople
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: