Announcements
Get a collection
GET /announcements HTTP/1.1Query string parameters
All query string parameters are optional.
-
announcement_categoriescomma-separated list of IDs -
Return announcements assigned to the given announcement categories.
-
audiencecomma-separated list -
Return announcements assigned to the specified audience(s). Options:
faculty,staff,students -
callbackstring -
Wraps the response in a callback function of the given name. Use this parameter to facilitate JSONP requests.
-
divisionscomma-separated list of IDs -
Return announcements assigned to the given divisions.
-
excluded_idscomma-separated list of IDs -
Returns announcements, except those with the given IDs.
-
idscomma-separated list of IDs -
Return announcements with the given IDs.
-
order_bycomma-separated list -
Sort announcements by one or more
ORDER_BYandORDERparameter pairs. Options:Format:
ORDER_BY|ORDER[,ORDER_BY|ORDER,...]Default value:
publish_date|desc,id|asc -
pageinteger -
Return announcements from a specific page of a collection.
Default value:
1 -
per_pageinteger -
Number of announcements to return per page of a collection. Maximum:
100Default value:
5 -
tagscomma-separated list of IDs -
Return announcements assigned to the given tags.
Response
In the example response, embedded announcements are truncated for illustrative purposes. In the real-world version of the response, "...announcement object..." is an entire announcement resource.
{
"_embedded": {
"announcements": [
"...announcement object...",
"...announcement object...",
"...announcement object...",
"...announcement object...",
"...announcement object..."
]
},
"_links": {
"find": {
"href": "/announcements/{?id}",
"templated": true
},
"next": {
"href": "/announcements?page=3"
},
"prev": {
"href": "/announcements?page=1"
},
"self": {
"href": "/announcements?page=2"
}
},
"page": 1,
"per_page": 5,
"return_count": 5,
"total_available": 100
}Attributes
-
_embeddedhash -
Embedded resources.
-
_embedded.announcements[]array -
An array of announcement objects.
-
_linkshash -
Links to resources associated with the announcement 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 announcements requested per page.
-
return_countinteger -
Number of announcements returned.
-
total_availableinteger -
Total number of announcements available in the collection.
Get one
GET /announcements/:id HTTP/1.1Endpoint parameters
-
idinteger required -
The unique identifier of the announcement.
Response
GET /announcements/12973
{
"_embedded": {
"announcement_categories": null,
"divisions": null,
"image_thumbnail": null,
"tags": null
},
"_links": {
"self": {
"href": "/announcements/12973"
}
},
"alt_headline": "Workshop: Surviving and Thriving in an Academic Career",
"audience": [
"faculty",
"staff",
"students"
],
"author": "Hub staff report",
"excerpt": "This multidisciplinary workshop, hosted by the School of Nursing, will be held June 1-3 at the Bloomberg School",
"headline": "Save the date: Surviving and Thriving in an Academic Career workshop, June 1-3",
"id": 12973,
"publish_date": 1457928000,
"short_url": "https://hub.jhu.edu/announcements/2016/03/14/save-the-date-surviving-and-thriving-in-an-academic-career-workshop-june-1-3-2016/",
"slug": "save-the-date-surviving-and-thriving-in-an-academic-career-workshop-june-1-3-2016",
"teaser_kicker": "SAVE THE DATE",
"type": "announcement",
"url": "https://hub.jhu.edu/announcements/2016/03/14/save-the-date-surviving-and-thriving-in-an-academic-career-workshop-june-1-3-2016/"
}Attributes
-
_embeddedhash -
Embedded resources.
-
_embedded.announcement_categories[]array|null -
An array of announcement categories assigned to the announcement or
nullif none are assigned. -
_embedded.divisions[]array|null -
An array of divisions assigned to the announcement or
nullif none are assigned. -
_embedded.image_thumbnail[]array|null -
An array containing the file assigned as the thumbnail image of the announcement or
nullif not assigned -
_embedded.tags[]array|null -
An array of tags assigned to the announcement or
nullif none are assigned. -
_linkshash -
Links to resources associated with the announcement.
-
_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. -
audiencearray -
Audience(s) that the announcement is targeted to. Possible values:
faculty,staff, and/orstudents -
authorstring -
The name of the author.
-
excerptstring -
A short summary of the announcement.
-
headlinestring -
The title of the announcement.
-
idinteger -
Unique identifier of the announcement.
-
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 -
Full URL of the announcement.
Get a subcollection
A subcollection is a collection of objects contained within an announcement.
GET /announcements/:id/:subcollection HTTP/1.1Endpoint parameters
-
idinteger - The unique identifier of the announcement.
-
subcollectionstring -
The name of the subcollection to retrieve. Options:
announcement_categories,divisions, ortags
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: