race-attendance/README.md

30 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2017-08-31 14:14:54 +00:00
## Worflow
2017-09-01 04:23:40 +00:00
install the dependencies by running `pip install -r requirements.txt`
2017-08-31 14:14:54 +00:00
start the server by running
`$python server.py`
### Login
2017-09-01 04:23:40 +00:00
`$ http --session=./session.json -f POST http://127.0.0.1:5000/api/login username=user@example.com password=password`
2017-08-31 14:14:54 +00:00
### Update Attendance
2017-09-01 04:58:56 +00:00
The `time` is optional and it may contain values *'now'* or *ISO-8601 time-string*
2017-09-01 04:23:40 +00:00
#### 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`
2017-08-31 16:37:58 +00:00
### Get Attendance
2017-09-01 04:58:56 +00:00
The `start_time` and `end_time` are optional and they may contain values *'now'* or **time string**
2017-09-01 04:23:40 +00:00
#### 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:
2017-09-01 04:45:22 +00:00
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/attendance/class?identifier=1"`
2017-09-01 05:08:14 +00:00
### Logout
`$ http --session=./session.json GET "http://127.0.0.1:5000/api/logout"`