Events
Events are, admittedly, a little confusing. To help alleviate this confusion, keep the following in mind when working with events:
- Events can be either one-time events or recurring.
- Events can have a specific start and end time or last all day. The values of the
startandendproperties will depend on whether the event has a specific start and end time or lasts all day.
Get a collection
GET /events 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 events assigned to the given channels.
-
datestring -
Return events that take place on a specific date or within a date range. If specifying a range, separate start and end dates with a comma.
Format:
YYYY-MM-DD[,YYYY-MM-DD] -
divisionscomma-separated list of IDs -
Return events assigned to the given divisions.
-
event_categoriescomma-separated list of IDs -
Return events assigned to the given event categories.
-
excluded_idscomma-separated list of IDs -
Returns events, except those with the given IDs.
-
idscomma-separated list of IDs -
Return events with the given IDs.
-
include_subtermscomma-separated list of IDs -
Works in conjunction with hierarchical taxonomy parameters to ensure returned events are assigned to either the specified term(s) or the children of the specified term(s). Hierarchical taxonomy parameter(s) available on events: event categories and locations
For example,
/events?locations=668&include_subterms=668will return events assigned to term #668 (Homewood Campus) and any other location whose parent is Homewood Campus. -
locationscomma-separated list of IDs -
Return events assigned to the given locations.
-
open_tocomma-separated list -
Return events that may be attended by the given audience(s). Options:
faulty,staff,students,everyoneDefault value:
everyone -
order_bycomma-separated list -
Sort events by one or more
ORDER_BYandORDERparameter pairs. Options:Format:
ORDER_BY|ORDER[,ORDER_BY|ORDER,...]Default value:
start_date|asc,id|asc -
pageinteger -
Return events from a specific page of a collection.
Default value:
1 -
per_pageinteger -
Number of events to return per page of a collection. Maximum:
100Default value:
5 -
single_eventsboolean -
When
true, recurring events are expanded into individual event objects. For example, an event that recurs 10 times will be represented with 10 separate objects in the event collection.When
false, recurring events are returned as a single event object. For example, an event that recurs 10 times will be represented with 1 object in the event collection. Inspect_embedded.event_instancesfor a list of all instances of the event.Default value:
true -
sourcecomma-separated list -
Return events published by the specified source(s). Options:
Default value:
hub -
start_datestring -
Return events that start on a specific date.
Format:
YYYY-MM-DD -
tagscomma-separated list of IDs -
Return events assigned to the given tags.
-
typecomma-separated list -
Return events of a specific type. Options:
Default value:
upcoming
Response
In the example response, embedded events are truncated for illustrative purposes. In the real-world version of the response, "...event object..." is an entire event resource.
{
"_embedded": {
"events": [
"...event object...",
"...event object...",
"...event object...",
"...event object...",
"...event object..."
]
},
"_links": {
"find": {
"href": "/events/{?id}",
"templated": true
},
"next": {
"href": "/events?page=3"
},
"prev": {
"href": "/events?page=1"
},
"self": {
"href": "/events?page=2"
}
},
"page": 1,
"per_page": 5,
"return_count": 5,
"total_available": 100
}Attributes
-
_linkshash -
Links to resources associated with the event 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 events requested per page.
-
return_countinteger -
Number of events returned.
-
total_availableinteger -
Total number of events available in the collection.
Get one
GET /events/:id HTTP/1.1Endpoint parameters
-
idinteger required -
The unique identifier of the event.
Response
GET /events/52177
{
"_embedded": {
"divisions": null,
"event_categories": null,
"event_instances": null,
"image_thumbnail": null,
"locations": null,
"tags": null
},
"_links": {
"self": {
"href": "/events/52177"
}
},
"end": {
"dateTime": "2023-05-17T16:00:00-04:00",
"timestamp": 1684353600
},
"end_date": "2023-05-17",
"end_time": "16:00",
"excerpt": "Inspired by archival photographs from over 100 years ago, current Gilman photography students working under teacher Sarah Sachs have created original art that merges the past with the present. Exhibition on view from May 17 to Sept. 17.",
"id": 52177,
"name": "Gilman: A Pictured History",
"open_to": [
"everyone",
"faculty",
"staff",
"students"
],
"publish_date": 1683572302,
"short_url": "https://hub.jhu.edu/events/2023/05/17/gilman-a-pictured-history/",
"slug": "gilman-a-pictured-history",
"start": {
"dateTime": "2023-05-17T11:00:00-04:00",
"timestamp": 1684335600
},
"start_date": "2023-05-17",
"start_time": "11:00",
"type": "event",
"url": "https://hub.jhu.edu/events/2023/05/17/gilman-a-pictured-history/"
}Attributes
-
_embeddedhash -
Embedded resources.
-
_embedded.divisions[]array|null -
An array of divisions assigned to the event or
nullif none are assigned. -
_embedded.event_categories[]array|null -
An array of event categories assigned to the event or
nullif none are assigned. -
_embedded.event_instances[]array -
An array of instances of the event. Will consist of multiple instances if the event is recurring.
Note: This attribute is not present when the event object is part of a collection where the single_events query string parameter is true (the default). See the event’s start and end attributes instead.
-
_embedded.event_instances[].endhash -
The end date and/or time of the event instance.
-
_embedded.event_instances[].end.datestring -
The date in
YYYY-MM-DDformat. Present on events that are all day events. -
_embedded.event_instances[].end.dateTimestring -
The date and time in ISO 8601 format. Present on events that have specific start/end times.
-
_embedded.event_instances[].end.timestamptimestamp -
The date and time as a Unix timestamp. Present on events that have specific start/end times.
-
_embedded.event_instances[].idstring -
Unique ID of the event instance.
-
_embedded.event_instances[].starthash -
The start date and/or time of the event instance.
-
_embedded.event_instances[].start.datestring -
The date in
YYYY-MM-DDformat. Present on events that are all day events. -
_embedded.event_instances[].start.dateTimestring -
The date and time in ISO 8601 format. Present on events that have specific start/end times.
-
_embedded.event_instances[].start.timestamptimestamp -
The date and time as a Unix timestamp. Present on events that have specific start/end times.
-
_embedded.event_instances[].typestring -
Type of resource.
-
_embedded.event_instances[].urlstring -
Full URL of the event instance.
-
_embedded.image_thumbnail[]array|null -
An array containing the file assigned as the thumbnail image of the event or
nullif not assigned -
_embedded.locations[]array|null -
An array of locations assigned to the event or
nullif none are assigned. -
_embedded.tags[]array|null -
An array of tags assigned to the event or
nullif none are assigned. -
_linkshash -
Links to resources associated with the event.
-
_links.selflink object -
A link that identifies the current resource.
-
_links.self.hrefstring -
URI of the link.
-
endhash -
The end date and/or time of the event instance.
If the event is part of a collection where the
single_eventsquery string parameter istrue(the default), this attribute’s value reflects the event instance represented by this object in the collection. Otherwise, it reflects the first upcoming instance of this event. -
end.datestring -
The date in
YYYY-MM-DDformat. Present on events that are all day events. -
end.dateTimestring -
The date and time in ISO 8601 format. Present on events that have specific start/end times.
-
end.timestamptimestamp -
The date and time as a Unix timestamp. Present on events that have specific start/end times.
-
end_datedeprecated -
end_timedeprecated -
excerptstring -
A short summary of the event.
-
idinteger -
Unique identifier of the event.
-
namestring -
The title of the event.
-
open_toarray -
A list of audiences that can attend the event. Possible values:
faulty,staff,students,everyone -
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.
-
starthash -
The start date and/or time of the event instance.
If the event is part of a collection where the
single_eventsquery string parameter istrue(the default), this attribute’s value reflects the event instance represented by this object in the collection. Otherwise, it reflects the first upcoming instance of this event. -
start.datestring -
The date in
YYYY-MM-DDformat. Present on events that are all day events. -
start.dateTimestring -
The date and time in ISO 8601 format. Present on events that have specific start/end times.
-
start.timestamptimestamp -
The date and time as a Unix timestamp. Present on events that have specific start/end times.
-
start_datedeprecated -
start_timedeprecated -
typestring -
Type of resource.
-
urlstring -
Full URL of the event.
Get a subcollection
A subcollection is a collection of objects contained within an event.
GET /events/:id/:subcollection HTTP/1.1Endpoint parameters
-
idinteger - The unique identifier of the event.
-
subcollectionstring -
The name of the subcollection to retrieve. Options:
channels,divisions,event_categories,locations, 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: