@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Statutory Instruments API
@version v1
@endpoints 16
@toc api(16)

@endpoint GET /api/v1/BusinessItem/{id}
@desc Returns business item by ID.
@required {id: str # Business item with the ID specified}
@optional {LaidPaper: str # Business item by laid paper type}
@returns(200) {value: map{id: str?, statutoryInstrumentId: str?, stepName: str?, itemDate: str(date-time)?, houses: [map]?, link: str?, laidPaperType: str, sequence: int(int32), statutoryInstrumentUri: str(uri)?, businessItemUri: str(uri)?, houseUri: str(uri)?, houseName: str?, procedureStepUri: str(uri)?, workpackageProcedureUri: str(uri)?, houseId: str?, procedureStepId: str?}, links: [map]?} # The requested business item
@errors {400: Bad Request, 404: If the item doesn't exist}

@endpoint GET /api/v1/LayingBody
@desc Returns all laying bodies.
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success

@endpoint GET /api/v1/Procedure
@desc Returns all procedures.
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success

@endpoint GET /api/v1/Procedure/{id}
@desc Returns procedure by ID.
@required {id: str # Procedure with the ID specified}
@returns(200) {value: map{id: str?, uri: str?, name: str?, description: str?}, links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument
@desc Returns a list of proposed negative statutory instruments.
@optional {Name: str # Proposed negative statutory instruments with the name provided, RecommendedForProcedureChange: bool # Proposed negative statutory instruments recommended for procedure change, DepartmentId: int(int32) # Proposed negative statutory instruments with the department ID specified, LayingBodyId: str # Proposed negative statutory instruments with the laying body ID specified, Skip: int(int32) # The number of records to skip from the first, default is 0, Take: int(int32) # The number of records to return, default is 20}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success
@errors {400: Bad Request}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument/{id}
@desc Returns proposed negative statutory instrument by ID.
@required {id: str # Proposed negative statutory instrument with the ID specified}
@returns(200) {value: map{id: str?, commonsLayingDate: str(date-time)?, commonsPublishedDate: str(date-time)?, lordsLayingDate: str(date-time)?, lordsPublishedDate: str(date-time)?, uri: str?, name: str?, departmentId: int(int32)?, layingBodyId: str?, layingBodyName: str?, procedureUri: str?, procedureName: str?, procedure: map{id: str?, uri: str?, name: str?}, layingBodyDepartment: map{departmentId: int(int32)?, name: str?, id: str?}, link: str?, statutoryInstrumentPaperId: str?, statutoryInstrumentPaperName: str?, statutoryInstrument: map{id: str?, name: str?}}, links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v1/ProposedNegativeStatutoryInstrument/{id}/BusinessItems
@desc Returns business items belonging to a proposed negative statutory instrument.
@required {id: str # Business items belonging to proposed negative statutory instrument with the ID specified}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v1/StatutoryInstrument
@desc Returns a list of statutory instruments.
@optional {Name: str # Statutory instruments with the name specified, StatutoryInstrumentType: str # Statutory instruments where the statutory instrument type is the type provided, ScheduledDebate: bool # Statutory instrument which contains a scheduled debate, MotionToStop: bool # Statutory instruments which contains a motion to stop, ConcernsRaisedByCommittee: bool # Statutory instruments which contains concerns raised by committee, ParliamentaryProcessConcluded: str # Statutory instruments where the parliamentary process is concluded or notconcluded, DepartmentId: int(int32) # Statutory instruments with the department ID specified, LayingBodyId: str # Statutory instruments with the laying body ID specified, House: str # Statutory instruments laid in the house specified, Skip: int(int32) # The number of records to skip from the first, default is 0, Take: int(int32) # The number of records to return, default is 20}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success
@errors {400: Bad Request}

@endpoint GET /api/v1/StatutoryInstrument/{id}
@desc Returns a statutory instrument by ID.
@required {id: str # Statutory instrument with the ID specified}
@returns(200) {value: map{id: str?, commonsLayingDate: str(date-time)?, commonsPublishedDate: str(date-time)?, lordsLayingDate: str(date-time)?, lordsPublishedDate: str(date-time)?, uri: str?, name: str?, departmentId: int(int32)?, layingBodyId: str?, layingBodyName: str?, procedureUri: str?, procedureName: str?, procedure: map{id: str?, uri: str?, name: str?}, layingBodyDepartment: map{departmentId: int(int32)?, name: str?, id: str?}, link: str?, paperNumber: int(int32)?, paperYear: str?, paperPrefix: str?, paperMadeDate: str(date-time), paperComingIntoForceDate: str(date-time)?, paperComingIntoForceNote: str?, proposedNegativeStatutoryInstrumentPaperId: str?, proposedNegativeStatutoryInstrumentPaperName: str?, proposedNegativeStatutoryInstrument: map{id: str?, name: str?}}, links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v1/StatutoryInstrument/{id}/BusinessItems
@desc Returns business items belonging to statutory instrument with ID.
@required {id: str # Business items belonging to statutory instrument with the ID specified}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v2/ActOfParliament
@desc Search through Acts of Parliament
@optional {Id: [str] # Acts of Parliament with the IDs specified., Name: str # Acts of Parliament with the name specified.}
@returns(200) Success
@errors {400: Bad Request}

@endpoint GET /api/v2/ActOfParliament/{id}
@desc Search individual Act of Parliament by ID
@required {id: str}
@returns(200) {id: str?, name: str?, link: str?, number: int(int32)?, royalAssent: str(date-time)?, year: int(int32)?} # Success
@errors {404: Not Found}

@endpoint GET /api/v2/StatutoryInstrument
@desc Search through statutory instruments and proposed negatives
@optional {Name: str # Statutory instruments with the name specified, Procedure: str # Statutory instruments made under the specified procedure, ScheduledDebate: bool # Statutory instrument which contains a scheduled debate, MotionToStop: bool # Statutory instruments which contains a motion to stop, ConcernsRaisedByCommittee: bool # Statutory instruments which contains concerns raised by committee, ParliamentaryProcessConcluded: bool # Statutory instruments where the parliamentary process is concluded or notconcluded, DepartmentId: int(int32) # Statutory instruments with the department ID specified, LayingBodyId: str # Statutory instruments with the laying body ID specified, RecommendedForProcedureChange: bool # Statutory instruments recommended for procedure change, ActOfParliamentId: [str] # Statutory instruments with the Act of Parliament ID specified, House: str # Statutory instruments laid in the house specified, Skip: int(int32) # The number of records to skip from the first, default is 0, Take: int(int32) # The number of records to return, default is 20}
@returns(200) {items: [map]?, totalResults: int(int32), itemsPerPage: int(int32), links: [map]?} # Success
@errors {400: Bad Request}

@endpoint GET /api/v2/StatutoryInstrument/{instrumentId}
@desc Get individual statutory instrument or proposed negative by id
@required {instrumentId: str # Id of instrument requested}
@returns(200) {value: map{id: str?, name: str?, paperPrefix: str?, paperNumber: int(int32)?, paperYear: str?, procedure: map{id: str?, name: str?}, paperMadeDate: str(date-time)?, commonsLayingDate: str(date-time)?, lordsLayingDate: str(date-time)?, workpackageId: str?, followedByInstrument: map{id: str?, name: str?, procedure: map{id: str?, name: str?}}, precededByInstrument: map{id: str?, name: str?, procedure: map{id: str?, name: str?}}, paperComingIntoForceDate: str(date-time)?, paperComingIntoForceNote: str?, layingBody: map{departmentId: int(int32)?, id: str?, name: str?}, enablingActs: [map]?, timelines: [map]?, link: str?}, links: [map]?} # Success
@errors {400: Bad Request, 404: Not Found}

@endpoint GET /api/v2/StatutoryInstrument/{instrumentId}/BusinessItems
@desc Get business items associated with a particular instrument
@required {instrumentId: str # Id of instrument to get business items for}
@returns(200) Success
@errors {400: Bad Request}

@endpoint GET /api/v2/Timeline/{timelineId}/BusinessItems
@desc Get business items associated with a particular timeline
@required {timelineId: str # Id of timeline to get business items for}
@returns(200) Success
@errors {400: Bad Request}

@end
