openapi: 3.0.0
servers:
  - url: http://www.bclaws.ca/civix
  - url: https://www.bclaws.ca/civix
info:
  description: |-
    BC Laws is an electronic library providing free public access to the laws of British Columbia. BC Laws is hosted by the Queen's Printer of British Columbia and published in partnership with the Ministry of Justice and the Law Clerk of the Legislative Assembly.BC Laws contains a comprehensive collection of BC legislation and related materials. It is available on the internet in two forms:First: The library is available as a web site in which users can browse and search the laws of British Columbia.Second: The library is available as a portal to legislation in raw XML data format, accessible via the BC Laws API2. This direct access to raw data is intended to enable third parties to build or add their own custom applications based on the structure of the data and all the associated search functionality inherent in that structure. The BC Laws website itself is an example of one such application. 

    Please note that you may experience issues when submitting requests to the delivery or test environment if using this [OpenAPI specification](https://github.com/bcgov/api-specs) in other API console viewers.
  license:
    name: Queen's Printer License
    url: http://www.bclaws.ca/standards/2014/QP-License_1.0.html
  termsOfService: http://www2.gov.bc.ca/gov/content?id=D1EE0A405E584363B205CD4353E02C88
  title: BC Laws
  version: 1.0.0
  x-apisguru-categories:
    - open_data
  x-logo:
    url: https://avatars1.githubusercontent.com/u/916280?v=3&s=200
  x-origin:
    - converter:
        url: https://github.com/mermade/oas-kit
        version: 2.6.2
      format: openapi
      url: https://raw.githubusercontent.com/bcgov/api-specs/master/bclaws/bclaws.json
      version: "3.0"
  x-providerName: bclaws.ca
  x-serviceName: bclaws
externalDocs:
  description: Additional API Documentation
  url: ttp://www.bclaws.ca/civix/template/complete/api/index.html
tags:
  - name: content
  - name: document
  - name: search
paths:
  "/content/{aspectId}":
    get:
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Describes the documents and directories available within a specific 'aspect' (content group) of the BCLaws library
      tags:
        - content
  "/content/{aspectId}/{civixDocumentId}":
    get:
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: The document identification code for an index or directory
          in: path
          name: civixDocumentId
          required: true
          schema:
            default: statreg
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Lists the metadata available for the specified index or directory from the BCLaws legislative respository
      tags:
        - content
  "/document/id/{aspectId}/{civixIndexId}/{civixDocumentId}":
    get:
      description: "The /document API allows you to retrieve actual documents from the BCLaws legislative repository. To retrieve a document from the repository you need the aspect identifier and two other specific pieces of information about the document: the index identifier and the document identifier. These unique identifiers can be retrieved from the /content API."
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: Index identification code
          in: path
          name: civixIndexId
          required: true
          schema:
            default: statreg
            type: string
        - description: The document identification code for an index or directory
          in: path
          name: civixDocumentId
          required: true
          schema:
            default: 01009_01
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Retrieves a specific document from the BCLaws legislative repository (HTML format)
      tags:
        - document
  "/document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/search/{searchString}":
    get:
      description: "The /document API allows you to retrieve actual documents from the BCLaws legislative repository. To retrieve a document from the repository you need the aspect identifier and two other specific pieces of information about the document: the index identifier and the document identifier. These unique identifiers can be retrieved from the /content API."
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: Index identification code
          in: path
          name: civixIndexId
          required: true
          schema:
            default: statreg
            type: string
        - description: The document identification code for an index or directory
          in: path
          name: civixDocumentId
          required: true
          schema:
            default: 01009_01
            type: string
        - description: The text to search for within the document
          in: path
          name: searchString
          required: true
          schema:
            default: water
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Retrieves a specific document from the BCLaws legislative repository with search text highlighted (HTML format)
      tags:
        - document
  "/document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/xml":
    get:
      description: "The /document API allows you to retrieve actual documents from the BCLaws legislative repository. To retrieve a document from the repository you need the aspect identifier and two other specific pieces of information about the document: the index identifier and the document identifier. These unique identifiers can be retrieved from the /content API."
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: Index identification code
          in: path
          name: civixIndexId
          required: true
          schema:
            default: statreg
            type: string
        - description: The document identification code for an index or directory
          in: path
          name: civixDocumentId
          required: true
          schema:
            default: 01009_01
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Retrieves a specific document from the BCLaws legislative repository (XML format)
      tags:
        - document
  "/document/id/{aspectId}/{civixIndexId}/{civixDocumentId}/xml/search/{searchString}":
    get:
      description: "The /document API allows you to retrieve actual documents from the BCLaws legislative repository. To retrieve a document from the repository you need the aspect identifier and two other specific pieces of information about the document: the index identifier and the document identifier. These unique identifiers can be retrieved from the /content API."
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: Index identification code
          in: path
          name: civixIndexId
          required: true
          schema:
            default: statreg
            type: string
        - description: The document identification code for an index or directory
          in: path
          name: civixDocumentId
          required: true
          schema:
            default: 01009_01
            type: string
        - description: The text to search for within the document
          in: path
          name: searchString
          required: true
          schema:
            default: water
            type: string
      responses:
        "200":
          description: List documents and directories within the aspect.
      summary: Retrieves a specific document from the BCLaws legislative repository with search text highlighted (XML format)
      tags:
        - document
  "/search/{aspectId}/fullsearch":
    get:
      parameters:
        - description: The identifier of the 'aspect' (content group) to search
          in: path
          name: aspectId
          required: true
          schema:
            default: complete
            enum:
              - complete
              - corpreg
              - bcgaz1
              - bcgaz2
              - oic
              - psl
              - ecb
              - hscr
              - arch_oic
            type: string
        - description: query term
          in: query
          name: q
          required: true
          schema:
            default: water
            type: string
        - description: first hit (start index)
          in: query
          name: s
          required: true
          schema:
            default: "0"
            type: string
        - description: last hit (end index)
          in: query
          name: e
          required: true
          schema:
            default: 20
            type: integer
        - description: number of fragment snippets to return (< 10)
          in: query
          name: nFrag
          required: true
          schema:
            default: 5
            type: integer
        - description: length of fragment snippets (< 200)
          in: query
          name: lFrag
          required: true
          schema:
            default: 100
            type: integer
      responses:
        "200":
          description: List of metadata available for the specified aspect and search term
      summary: A listing of metadata available for the specified aspect and search term from the BCLaws legislative repository
      tags:
        - search
components:
  schemas: {}
