Locations

Hierarchical taxonomy used to assign events to physical locations.

Get a collection

Endpoint
GET /locations 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 locations, except those with the given IDs.

ids comma-separated list of IDs

Return locations with the given IDs.

order_by comma-separated list

Sort locations 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 location 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 locations from a specific page of a collection.

Default value: 1

per_page integer

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

Default value: 5

slug comma-separated list

Return locations matching the given slug(s).

Response

In the example response, embedded locations are truncated for illustrative purposes. In the real-world version of the response, "...location object..." is an entire location resource.

The location collection
{
   "_embedded": {
      "locations": [
         "...location object...",
         "...location object...",
         "...location object...",
         "...location object...",
         "...location object..."
      ]
   },
   "_links": {
      "find": {
         "href": "/locations/{?id}",
         "templated": true
      },
      "next": {
         "href": "/locations?page=3"
      },
      "prev": {
         "href": "/locations?page=1"
      },
      "self": {
         "href": "/locations?page=2"
      }
   },
   "page": 1,
   "per_page": 5,
   "return_count": 5,
   "total_available": 100
}

Attributes

_embedded hash

Embedded resources.

_embedded.locations[] array

An array of location objects.

page integer

The page number of the returned collection.

per_page integer

The number of locations requested per page.

return_count integer

Number of locations returned.

total_available integer

Total number of locations available in the collection.

Get one

Endpoint
GET /locations/:id HTTP/1.1

Endpoint parameters

id integer required

The unique identifier of the location.

Response

GET /locations/712
{
   "_embedded": {},
   "_links": {
      "self": {
         "href": "/locations/712"
      }
   },
   "address": "3400 North Charles Street",
   "city": "Baltimore",
   "email": null,
   "id": 712,
   "latitude": 39.329094,
   "longitude": -76.618792,
   "name": "The Beach",
   "parent": {
      "id": 668,
      "name": "Homewood Campus",
      "slug": "homewood-campus"
   },
   "phone": null,
   "slug": "beach",
   "state": "Maryland",
   "type": "location",
   "url": null,
   "website": null,
   "zipcode": 21218
}

Attributes

_embedded hash

Embedded resources.

address string

city string

email string

id integer

Unique identifier of the location.

latitude float

longitude float

name string

The nice name of the location.

parent hash|null

The parent location, if there is one.

parent.id integer

Unique identifier of the parent location.

parent.name string

The nice name of the parent location.

parent.slug string

The name of the parent location used in URLs.

phone string

slug string

The name of the location used in URLs.

state string

type string

Type of resource.

url hash

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

website string

URL of the location’s website, if it has one.

zipcode integer

Get a subcollection

A subcollection is a collection of objects contained within a location.

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

Endpoint parameters

id integer
The unique identifier of the location.
subcollection string

The name of the subcollection to retrieve. Options: events

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: