Skip to content

Latest commit

 

History

History
245 lines (219 loc) · 6.28 KB

File metadata and controls

245 lines (219 loc) · 6.28 KB

Exhibitions

Nota Bene

These endpoints are in a very "draft" state. There are a number of details not yet accounted for. Namely:

  • Exhibitions need to be attached to the site where they occur and the endpoints need to be something like ../exhibitions/new-york ../exhibitions/bilbao. There is not an objvious way that this is recorded in the underlying data.
  • You should be able to request exhibitions by past or future date. "Starting from today" is a meaningful default
  • Perhaps there needs to be an endpoint ../exhibitions/{id}/constituents to conveniently get a list of artists in the exhibition? Ditto movements? Type?

Endpoints

Endpoint Description Returns
/exhibitions Index of exhibitions Array of Exhibition objects
/exhibitions/{id} Retrieve exhibition with corresponding `id` One Exhibition object

/exhibitions

Returns an all exhibitions in the collection as an array of Exhibition objects. Each Exhibition has a paginated objects resource.

Parameter Req'd? Description
per_page optional The maximum number of items on to return on each page (Default 5, maximum 100).

Example

Request:

curl http://api.guggenheim.org/exhibitions?no_objects=1

Response:

{
    "exhibitions": [
        {
            "id": 4537,
            "name": "Picasso Black and White", 
            "dates": {
                "begin": "2012-10-05", 
                "end": "2013-01-23",
                "display": "October 5, 2012 - January 23, 2013"
            }, 
            "objects": {
                "total_count": 116
            },
            "_links": {
                "_self": {
                    "href": "http://api.guggenheim.org/exhibitions/4537"
                }
            }
        }, 
        {
            "id": 4886,
            "name": "GUTAI", 
            "dates": {
                "begin": "2013-02-15", 
                "end": "2013-05-08",
                "display": "February 15, 2013-May 8, 2013"
            }, 
            "objects": {
                "total_count": 160
            },
            "_links": {
                "_self": {
                    "href": "http://api.guggenheim.org/exhibitions/4886"
                }
            }
        }
    ],
    "_links": {
        "_self": {
            "href": "http://api.guggenheim.org/exhibitions"
        }, 
        "item": {
            "href": "http://api.guggenheim.org/exhibitions/{id}"
        }
    } 
}

/exhibitions/{id}

Returns the exhibition specified by the id.

Parameter Req'd? Description
page optional The page of the paginated objects resource to return (default 1).
per_page optional The maximum number of items on to return on each page (default 20, maximum 100).
no_objects optional If set to any value, return only a count of the total number of objects. This option overrides page and per_page.

Example

Request:

curl http://api.guggenheim.org/exhibitions/4886

Response:

{
    "name": "GUTAI", 
    "dates": {
        "begin": "2013-02-15", 
        "display": "February 15, 2013-May 8, 2013", 
        "end": "2013-05-08"
    }, 
    "objects": {
        "count": 20, 
        "items_per_page": 20, 
        "page": 1, 
        "pages": 8, 
        "total_count": 160,
        "items": [...]
    },
    "_links": {
        "_self": {
            "href": "http://api.guggenheim.org/exhibitions/4886"
        }, 
        "next": {
            "href": "http://api.guggenheim.org/exhibitions/4886?per_page=20&page=2"
        }
    }, 
}

Exhibition objects

Example Exhibition object

{
    "name": "GUTAI", 
    "dates": {
        "begin": "2013-02-15", 
        "display": "February 15, 2013-May 8, 2013", 
        "end": "2013-05-08"
    }, 
    "objects": {
        "count": 20, 
        "items_per_page": 20, 
        "page": 1, 
        "pages": 8, 
        "total_count": 160,
        "items": [...]
    },
    "_links": {
        "_self": {
            "href": "http://api.guggenheim.org/exhibitions/4886"
        }, 
        "next": {
            "href": "http://api.guggenheim.org/exhibitions/4886?per_page=20&page=2"
        }
    }, 
}

Exhibition fields

Field Type Req'd? Description
name string REQUIRED Name of the exhibition
dates object REQUIRED A Dates object
objects object REQUIRED A paginated objects object
_links object REQUIRED A Links object