- Install the requirements
pip3 install -r requirements.txt
- Run the Endpoint
python3 api/api.py
Route based URL: http://0.0.0.0:8080/
interviews_calendar/
βββ search/
β βββ [GET]
β
βββ interviewer/
β βββ add-slots [POST]
β
βββ heartbeat/
β βββ [GET]
β
βββ interviewee/
β βββ available-times [GET]
β βββ available-times [POST]
β
βββ admin/
βββ view-all [GET]
The Interviewer can post a slot, in which he/she has time to interview somebody in!
Route | Method | Parameters |
---|---|---|
/interviews_calendar/interviewer/add-slots | POST | {"interviewers": list of strings, the names of the interviewers, "interviewee": string(optional field) the name of the interviewee, "start_times": list of strings, the datetime of the available times} |
curl -X POST \
http://0.0.0.0:8080/interviews_calendar/interviewer/add-slots \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{"interviewers": ["Morgan", "Geni mardoc", "JC-Quillet"], "start_times": ["12-1-2017 22:30", "01-01-2018 10:30"]}'
[
{
"end_time": "Friday 2017-12-01 from 23:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Friday 2017-12-01 from 22:30:00."
},
{
"end_time": "Monday 2018-01-01 from 11:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Monday 2018-01-01 from 10:30:00."
}
]
The Interviewee can view all the available slots (slots which no candidate took yet), and he/she can pick one to have an interview in.
Route | Method | Parameters |
---|---|---|
/interviews_calendar/interviewee/available-times | GET | - |
/interviews_calendar/interviewee/available-times | POST | {"interviewee": interviewee name, "slot_id": id of the time slot (consider that it's the zero-based array slot from the previous route)} |
curl -X GET \
http://0.0.0.0:8080/interviews_calendar/interviewee/available-times \
-H 'cache-control: no-cache'
[
{
"end_time": "Friday 2017-12-01 from 23:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Friday 2017-12-01 from 22:30:00."
},
{
"end_time": "Monday 2018-01-01 from 11:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Monday 2018-01-01 from 10:30:00."
}
]
curl -X POST \
http://0.0.0.0:8080/interviews_calendar/interviewee/available-times \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"interviewee": "interviewee name :)",
"slot_id": 1
}'
{
"end_time": "Monday 2018-01-01 from 11:30:00.",
"interviewee": "interviewee name :)",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Monday 2018-01-01 from 10:30:00."
}
The system Admin can view all the slots scheduled on the calender so far.
Route | Method | Parameters |
---|---|---|
/interviews_calendar/admin/view-all | GET | - |
curl -X GET \
http://0.0.0.0:8080/interviews_calendar/admin/view-all \
-H 'cache-control: no-cache' \
-H 'content-type: application/json'
[
{
"end_time": "Friday 2017-12-01 from 23:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Friday 2017-12-01 from 22:30:00."
},
{
"end_time": "Monday 2018-01-01 from 11:30:00.",
"interviewee": "interviewee name :)",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Monday 2018-01-01 from 10:30:00."
}
]
Anybody can search for the added slots in the calendar in a specific time frame
Route | Method | Parameters |
---|---|---|
/interviews_calendar/search | GET | - |
curl -X GET \
'http://0.0.0.0:8080/interviews_calendar/search?start_date=01-01-2018-10:30&end_date=05-05-2018-10:30' \
-H 'cache-control: no-cache' \
[
{
"end_time": "Monday 2018-01-01 from 11:30:00.",
"interviewee": "",
"interviewers": [
"Morgan",
"Geni mardoc",
"JC-Quillet"
],
"start_time": "Monday 2018-01-01 from 10:30:00."
}
]