Sets

Method: GET
Availability: Available since version 3

The Sets API call provides a JSON only interface for retrieving groups of favourite items ("sets") that users can publish on DigitalNZ. The public API includes functions for returning a list of sets from your user account, as well as returning a list of items for a specified set.

Private API functions also exist to create, update and destroy sets, as well as add and remove individual records from a set. Access privileges for these additional functions should be requested by contacting the DigitalNZ team.

List sets for a user

Get a list of sets created with your DigitalNZ user account.

URL format

http://api.digitalnz.org/v3/
sets
.json

Authentication Required

The following must be specified in the request headers:

  • api_key - developer API key. Your personal API key must be passed in the HTTP request header as 'Authentication-Token'.

Response format

JSON is the only supported response format for the Sets API.

Response elements

{
"sets": [{
"id": "50245211a9b6ad6820000001",
"name": "Dogs and Cats",
"count": 2, "priority": 0,
"homepage": false,
"created_at": "2011-11-17T13:13:35+13:00",
"updated_at": "2012-04-24T12:11:25+12:00",
"records": [{
"record_id": 2,
"position": 1
}, {
"record_id": 45,
"position": 2
}]
}]
}

Get records for a set

Get information about a set and its associated item records. You must know the identifier of the set you require.

URL format

http://api.digitalnz.org/v3/sets/
<id>
.json

Authentication Required

The following must be specified in the request headers:

  • api_key - developer API key. Your personal API key must be passed in the HTTP request header as 'Authentication-Token'.

  • id - ID of the required set

Example:

http://api.digitalnz.org/v3/sets/
536b0d9a8d2a4e7dff000001
.json

Response elements

{
"set": {
"id": "50245211a9b6ad6820000001",
"name": "Dogs and Cats",
"count": 1,
"priority": 0,
"homepage": false,
"created_at": "2011-11-17T13:13:35+13:00",
"updated_at": "2012-04-24T12:11:25+12:00",
"description": null,
"privacy": "public",
"tags": ["dogs", "cats"],
"records": [{
"record_id": 2,
"position": 1,
"title": "Dogs in the park",
"description": "Dogs playing in the Karori park",
"large_thumbnail_url": null,
"thumbnail_url": null,
"display_content_partner": "Auckland War Memorial Museum Tamaki Paenga Hira",
"display_collection": "Auckland Museum Library Catalogue",
"landing_url": "http://muse.aucklandmuseum.com/databases/Muscat/69103.detail",
"category": ["Images"],
"date": null,
"dnz_type": "Unknown",
"dc_identifier": ["G9230"],
"creator": null
}],
"user": {
"name": "Chris"
}
}
}