@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api DigitalNZ API
@base https://api.digitalnz.org
@version 3
@auth ApiKey api_key in query
@endpoints 3
@toc records.{format}(1), records(2)

@group records.{format}
@endpoint GET /records.{format}
@required {format: str(json/xml)}
@optional {Authentication-Token: str, text: str, and[category][]: str(Newspapers/Images/Books/Articles/Journals/Archives/Audio/Other/Manuscripts/Reference sources/Research papers/Videos/Music Score/Groups/Data/Websites/Sets), and[content_partner][]: str, and[primary_collection][]: str, and[collection][]: str, and[usage][]: str(Share/Modify/Use commercially/All rights reserved/Unknown), and[subject][]: str, and[dc_type][]: str, and[format][]: str, and[placename][]: str, and[creator][]: str, and[title][]: str, and[date]: str, and[year]: str, and[decade]: str, and[century]: str, without[{filter_field}]: str, and[or][{filter_field}][]: str, and[is_commercial_use]: bool, and[has_large_thumbnail_url]: str, and[has_lat_lng]: bool(true/false), geo_bbox: str, fields: str, sort: str(syndication_date/date), direction: str(asc/desc)=asc, page: int=1, per_page: int=20, facets: [str], facets_page: int=null, facets_per_page: int=10, exclude_filters_from_facets: bool=false}
@returns(200) {result_count: int, page: int, per_page: int, request_url: str, records: [map], facets: map}
@errors {400, 403}

@endgroup

@group records
@endpoint GET /records/{record_id}.{format}
@required {record_id: int, format: str(json/xml)}
@optional {Authentication-Token: str, fields: str}
@returns(200) {id: int, created_at: str(date-time), updated_at: str(date-time), title: str, description: str, content_partner: [str], display_content_partner: str, display_collection: str, primary_collection: [str], collection: [str], collection_title: [str], category: [str], creator: [str], subject: [str], dc_identifier: [str], date: [str], display_date: str, landing_url: str, source_url: str, thumbnail_url: str, large_thumbnail_url: str, usage: [str], copyright: [str], rights: str, rights_url: [str], locations: [map]}
@errors {403, 404}

@endpoint GET /records/{record_id}/more_like_this.{format}
@required {record_id: int, format: str(json/xml)}
@optional {Authentication-Token: str, fields: str, mlt_fields: str, filtering: str}
@returns(200) {result_count: int, page: int, per_page: int, request_url: str, records: [map]}
@errors {403, 404}

@endgroup

@end
