Topics
High-level topic-based hierarchical taxonomy used to categorize articles and galleries.
Get a collection
GET /topics 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 topics, except those with the given IDs.
-
ids
comma-separated list of IDs -
Return topics with the given IDs.
-
order_by
comma-separated list -
Sort topics by one or more
ORDER_BY
andORDER
parameter pairs. Options:Format:
ORDER_BY|ORDER[,ORDER_BY|ORDER,...]
Default value:
name|asc
-
page
integer -
Return topics from a specific page of a collection.
Default value:
1
-
per_page
integer -
Number of topics to return per page of a collection. Maximum:
100
Default value:
5
-
slug
comma-separated list -
Return topics matching the given slug(s).
Response
In the example response, embedded topics are truncated for illustrative purposes. In the real-world version of the response, "...topic object..."
is an entire topic resource.
{
"_embedded": {
"topics": [
"...topic object...",
"...topic object...",
"...topic object...",
"...topic object...",
"...topic object..."
]
},
"_links": {
"find": {
"href": "/topics/{?id}",
"templated": true
},
"next": {
"href": "/topics?page=3"
},
"prev": {
"href": "/topics?page=1"
},
"self": {
"href": "/topics?page=2"
}
},
"page": 1,
"per_page": 5,
"return_count": 5,
"total_available": 100
}
Attributes
-
_links
hash -
Links to resources associated with the topic collection.
-
_links.find
link object -
A templated link that can be used to find a specific resource in the collection.
-
_links.find.href
string -
URI of the link.
-
_links.find.templated
boolean -
Identifies the href as a templated URI.
-
_links.next
link 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.href
string -
URI of the link.
-
_links.prev
link 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.href
string -
URI of the link.
-
_links.self
link object -
A link that identifies the current resource.
-
_links.self.href
string -
URI of the link.
-
page
integer -
The page number of the returned collection.
-
per_page
integer -
The number of topics requested per page.
-
return_count
integer -
Number of topics returned.
-
total_available
integer -
Total number of topics available in the collection.
Get one
GET /topics/:id HTTP/1.1
Endpoint parameters
-
id
integer required -
The unique identifier of the topic.
Response
GET /topics/3162
{
"_embedded": {},
"_links": {
"self": {
"href": "/topics/3162"
}
},
"id": 3162,
"name": "Tools+Tech",
"parent": {
"id": 3158,
"name": "At Work",
"slug": "at-work"
},
"slug": "tools-tech",
"type": "topic",
"url": {
"articles": "https://hub.jhu.edu/at-work/tools-tech/"
}
}
Attributes
-
_embedded
hash -
Embedded resources.
-
_links
hash -
Links to resources associated with the topic.
-
_links.self
link object -
A link that identifies the current resource.
-
_links.self.href
string -
URI of the link.
-
id
integer -
Unique identifier of the topic.
-
name
string -
The nice name of the topic.
-
parent
hash|null -
The parent topic, if there is one.
-
parent.id
integer -
Unique identifier of the parent topic.
-
parent.name
string -
The nice name of the parent topic.
-
parent.slug
string -
The name of the parent topic used in URLs.
-
slug
string -
The name of the topic used in URLs.
-
type
string -
Type of resource.
-
url
hash -
URLs that point to collections of content in this topic on the Hub website.
-
url.articles
string -
Points to the collection of articles in this topic on the Hub.
Get a subcollection
A subcollection is a collection of objects contained within a topic.
GET /topics/:id/:subcollection HTTP/1.1
Endpoint parameters
-
id
integer - The unique identifier of the topic.
-
subcollection
string -
The name of the subcollection to retrieve. Options:
articles
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: