@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api BC Laws
@base http://www.bclaws.ca/civix
@version 1.0.0
@common_fields {aspectId: str(complete/corpreg/bcgaz1/bcgaz2/oic/psl/ecb/hscr/arch_oic)=complete # The identifier of the 'aspect' (content group) to search}
@endpoints 7
@toc content(2), document(4), search(1)

@group content
@endpoint GET /content/{aspectId}
@desc Describes the documents and directories available within a specific 'aspect' (content group) of the BCLaws library
@returns(200) List documents and directories within the aspect.

@endpoint GET /content/{aspectId}/{civixDocumentId}
@desc Lists the metadata available for the specified index or directory from the BCLaws legislative respository
@required {civixDocumentId: str=statreg # The document identification code for an index or directory}
@returns(200) List documents and directories within the aspect.

@endgroup

@group document
@endpoint GET /document/id/{aspectId}/{civixIndexId}/{civixDocumentId}
@desc Retrieves a specific document from the BCLaws legislative repository (HTML format)
@required {civixIndexId: str=statreg # Index identification code, civixDocumentId: str=01009_01 # The document identification code for an index or directory}
@returns(200) List documents and directories within the aspect.

@endpoint GET /document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/xml
@desc Retrieves a specific document from the BCLaws legislative repository (XML format)
@required {civixIndexId: str=statreg # Index identification code, civixDocumentId: str=01009_01 # The document identification code for an index or directory}
@returns(200) List documents and directories within the aspect.

@endpoint GET /document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/search/{searchString}
@desc Retrieves a specific document from the BCLaws legislative repository with search text highlighted (HTML format)
@required {civixIndexId: str=statreg # Index identification code, civixDocumentId: str=01009_01 # The document identification code for an index or directory, searchString: str=water # The text to search for within the document}
@returns(200) List documents and directories within the aspect.

@endpoint GET /document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/xml/search/{searchString}
@desc Retrieves a specific document from the BCLaws legislative repository with search text highlighted (XML format)
@required {civixIndexId: str=statreg # Index identification code, civixDocumentId: str=01009_01 # The document identification code for an index or directory, searchString: str=water # The text to search for within the document}
@returns(200) List documents and directories within the aspect.

@endgroup

@group search
@endpoint GET /search/{aspectId}/fullsearch
@desc A listing of metadata available for the specified aspect and search term from the BCLaws legislative repository
@required {q: str=water # query term, s: str=0 # first hit (start index), e: int=20 # last hit (end index), nFrag: int=5 # number of fragment snippets to return (< 10), lFrag: int=100 # length of fragment snippets (< 200)}
@returns(200) List of metadata available for the specified aspect and search term

@endgroup

@end
