race-attendance/README.md

30 lines
1.2 KiB
Markdown

## Worflow
install the dependencies by running `pip install -r requirements.txt`
start the server by running
`$python server.py`
### Login
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/login username=user@example.com password=password`
### Update Attendance
The `time` is optional and it may contain values *'now'* or *ISO-8601 time-string*
#### Student :
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/attendance/student presence=absent identifier=2 time=now`
#### Class :
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/attendance/class presence=present identifier=1 time=now`
### Get Attendance
The `start_time` and `end_time` are optional and they may contain values *'now'* or **time string**
#### Student:
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=2&start_time=now&end_time=now"`
or
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/student?identifier=3&start_time=now&end_time=now"`
#### Class:
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/class?identifier=1"`
### Logout
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/logout"`