@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api API for the COVID-19 Tracking QR Code Signin Server.
@base https://virtserver.swaggerhub.com/aijaz/QRCodeSigninServer/1.1
@version 1.1
@auth ApiKey token in header
@endpoints 14
@toc login(1), logout(1), signins(1), signin(4), verifyPasswordChange(1), changePassword(1), requestPasswordReset(1), user(3), users(1)

@group login
@endpoint POST /login
@desc Log in to get an API token
@optional {email: str, password: str, source: str(iOS/android/web)}
@returns(200) {admin: bool, login_id: int, name: str, read_only: bool, token: str} # Success
@errors {401: Unauthorized}

@endgroup

@group logout
@endpoint POST /logout
@desc Log out
@returns(200) Success

@endgroup

@group signins
@endpoint GET /signins
@desc Get signin info
@optional {less_than: int # Return signins with IDs less than this value., return_count: int=100 # Return this many objects}
@returns(200) Successful response
@errors {401: Unauthorized, 503: Key Failure}

@endgroup

@group signin
@endpoint POST /signin
@desc Create a new signin record
@required {name: str # The person's name, phone: str # The person's phone number}
@optional {id: int # The record id, dt: num # The original scan time in number of seconds since 1/1/1970 (GMT), email: str # The person's email}
@returns(200) {result: int} # Success
@errors {401: Unauthorized, 503: Key Failure}

@endpoint GET /signin/{signinId}
@desc Retrieve the information associated with a signin record
@required {signinId: int # The ID of the signin record to be retrieved.}
@returns(200) {id: int, dt: num, name: str, phone: str, email: str} # Success
@errors {401: Unauthorized}

@endpoint PUT /signin/{signinId}
@desc Update a signin record
@required {signinId: int # The ID of the signin record to be retrieved., name: str # The person's name, phone: str # The person's phone number}
@optional {id: int # The record id, dt: num # The original scan time in number of seconds since 1/1/1970 (GMT), email: str # The person's email}
@returns(200) {id: int, name: str, email: str, admin: bool, read_only: bool} # Success
@errors {401: Unauthorized}

@endpoint DELETE /signin/{signinId}
@desc Delete a signin record
@required {signinId: int # The ID of the signin record to be deleted.}
@returns(200) Success
@errors {401: Unauthorized}

@endgroup

@group verifyPasswordChange
@endpoint POST /verifyPasswordChange
@desc Used for resetting your password when you forgot it
@optional {guid: str # The password reset code, password: str # The new password}
@returns(200) Success
@errors {401: Unauthorized}

@endgroup

@group changePassword
@endpoint POST /changePassword
@desc Used for changing your password
@optional {old_password: str # The old (current) password, password: str # The new password}
@returns(200) Success
@errors {401: Unauthorized}

@endgroup

@group requestPasswordReset
@endpoint POST /requestPasswordReset
@desc Used for requesting a password reset code
@optional {email: str # The user whose password you want to reset}
@returns(200) {email: str, guid: str} # Success
@errors {401: Unauthorized}

@endgroup

@group user
@endpoint POST /user
@desc Create a user
@optional {email: str # The email address of the user record you want to create, name: str # The name of the user record you want to create, admin: bool # If the user has admin privileges then the user will be able to create password reset requests on behalf of other users, and will also be able to view and edit  the data of other users., read_only: bool # Not used in this version of the API. For future use.}
@returns(200) {email: str, guid: str} # Success
@errors {401: Unauthorized}

@endpoint DELETE /user/{userId}
@desc Delete a team member's user record
@required {userId: int # The ID of the user record to be deleted.}
@returns(200) Success
@errors {401: Unauthorized}

@endpoint GET /user/{userId}
@desc Retrieve the information associated with a team member's user record
@required {userId: int # The ID of the user record to be retrieved.}
@returns(200) {id: int, name: str, email: str, admin: bool, read_only: bool} # Success
@errors {401: Unauthorized}

@endgroup

@group users
@endpoint GET /users
@desc Retrieve the information associated with all team members' user records
@returns(200) Success
@errors {401: Unauthorized}

@endgroup

@end
