This API provides a simple interface to find intersections of available time slots between candidates and interviewers.
Currently it handles only JSON requests through the HTTP protocol and responses which are based on different storage engines, like memory-based or a database wrapper.
These instructions will get you an overview of the project up and running on your local machine for development and testing purposes.
Interviewers and his appropiate slots will be stored. Candidates send a request including free slots and a list of interviewers.
- install python3 and virtualenv
- eventually upgrade virtualenv:
pip install --upgrade virtualenv
- create virtualenv with:
virtualenv -p python3 <env_name>
- activate virtualenv:
source <env_name>/bin/activate
- install additional packages:
pip install -r requirements.txt
- start API server which listens on http://localhost:5000
python3 src/flask_server.py
- to get a better overview how the request structs are built, feel free to run the tests
A complete flow including all HTTP methods can be executed by (started server required)
./src/test/test_json_files/fixture.sh
- http://localhost:5000/api/v1/interviewer
- http://localhost:5000/api/v1/slots/interviewer_1
- send available slots of interviewers, e.g. from testfiles in src/test/test_json_files:
curl -X POST http://localhost:5000/api/v1/slots -d @test_data_interviewer.json --header "Content-Type: application/json"
- send candidate request including his time slots to API. The API will respond with the commom time slots of
available interviewers:
orcurl -X GET http://localhost:5000/api/v1/slots -d @test_data_candidate_carl.json --header "Content-Type: application/json"
curl -X GET http://localhost:5000/api/v1/slots -d @test_data_candidate_tom.json --header "Content-Type: application/json"
Also an additional experimental approach with numpy was implemented.
Just send a POST request to the server by
curl -X GET http://localhost:5000/api/v1/slots_np -d @test_data_np.json --header "Content-Type: application/json"
Datetime strings have to be in format "YYYY-mm-dd HH:MM:SS"
- to POST new slots
{ "interviewer_1": [["slot_start", "slot_end"], [...]],
"interviewer_2": [[...]] }- GET available slots for a list of interviewer
{ "interviewer": ["interviewer_1", "interviewer_2", ...],
"candidate":{
"name": "name",
"slots": [["slot_start", "slot_end"], [...]]
}
}This project is licensed under the MIT License - see the LICENSE.md file for details