Get collections for a content provider

20 views
Skip to first unread message

Stuart Charters

unread,
Nov 27, 2012, 8:16:43 PM11/27/12
to digi...@googlegroups.com
Hi,
 
I'm just starting out with the DigitalNZ API.
 
What I would like to do is restrict a search to a collection of a content provider.
 
Essentially provide a similar functionality to that of the Content Provider & Websites filter on the main DigitalNZ search.
 
I can get a list of content providers from the content providers API call, but is there a way to then get the collections that belong to that content provider?
 
As an e.g The Treasury has two collections, The Treasury and the National Infrastructure Unit.
 
I can hard code a restriction with a faceted search but want to allow the user to choose the restriction.
 
Cheers
Stuart

Tim McNamara

unread,
Nov 27, 2012, 9:05:49 PM11/27/12
to digi...@googlegroups.com
Hi Stuart, welcome to the list.

The easiest way to do this is to build a custom search, which is a simple form-driven tool that results in a URL you can ping whenever you want data.

http://www.digitalnz.org/custom_searches/new
http://www.digitalnz.org/developers/api-docs-v3/custom-search-records-api-v3

Otherwise you can build the search query up yourself:

http://api.digitalnz.org/v3/records.json?api_key=[your_api_key]&text=economics&and=[content_partner][]=The+Treasury (untested!)

Docs here: http://www.digitalnz.org/developers/api-docs-v3/search-records-api-v3

Chris McDowall

unread,
Nov 27, 2012, 9:24:51 PM11/27/12
to digi...@googlegroups.com
Tim beat me to it. That's absolutely right. 

To get everything provided by Treasure you can do:

Stuart Charters

unread,
Nov 27, 2012, 10:19:28 PM11/27/12
to digi...@googlegroups.com
To achieve what I was after I realised I could do it with a search that just returned the facet values of the display collection for the content partner that I wanted.
 
 
Thanks
Stuart
Reply all
Reply to author
Forward
0 new messages