Channels

Hierarchical taxonomy used to create custom feeds of content.

Get a collection

Endpoint
GET /channels 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.

excluded_ids comma-separated list of IDs

Returns channels, except those with the given IDs.

ids comma-separated list of IDs

Return channels with the given IDs.

order_by comma-separated list

Sort channels 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 channel ID
    • list: order by the order of IDs given in the ids parameter
    • name: order by term name
    • weight: order by term weight

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

Default value: name|asc

page integer

Return channels from a specific page of a collection.

Default value: 1

per_page integer

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

Default value: 5

slug comma-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.

The channel collection
{
   "_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

_embedded hash

Embedded resources.

_embedded.channels[] array

An array of channel objects.

page integer

The page number of the returned collection.

per_page integer

The number of channels requested per page.

return_count integer

Number of channels returned.

total_available integer

Total number of channels available in the collection.

Get one

Endpoint
GET /channels/:id HTTP/1.1

Endpoint parameters

id integer 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

_embedded hash

Embedded resources.

id integer

Unique identifier of the channel.

name string

The nice name of the channel.

parent hash|null

The parent channel, if there is one.

parent.id integer

Unique identifier of the parent channel.

parent.name string

The nice name of the parent channel.

parent.slug string

The name of the parent channel used in URLs.

slug string

The name of the channel used in URLs.

type string

Type of resource.

url hash

URLs that point to collections of content in this channel on the Hub website.

url.articles string

Points to the collection of articles in this channel on the Hub.

url.events string

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.

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

Endpoint parameters

id integer
The unique identifier of the channel.
subcollection string

The name of the subcollection to retrieve. Options: articles, events, or people

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: