This guide helps you setup the backend server for the Chrome extension. The actual API is in the section below.
- Download PostgreSQL: https://postgresapp.com/downloads.html
- Set up the command line interface (CLI): https://postgresapp.com/documentation/cli-tools.html
- Follow this tutorial:
https://www.microfocus.com/documentation/idol/IDOL_12_0/MediaServer/Guides/html/English/Content/Getting_Started/Configure/_TRN_Set_up_PostgreSQL.htm
- Create a virtual environment for Python 3: https://docs.python.org/3/library/venv.html
- virtual environments help manage dependencies and make sure Python code works across computers
- Activate that virtual environment
- Clone this repo somewhere
- cd into the repo
- Run "pip install -r requirements.txt" - this command downloads all the Python libraries needed to run the backend server
- cd into the repo if not in there already
- Run "source setup.sh" - this sets up the environment variables
- Run "python api.py"
- Open up another terminal window while the server is running
- Activate your virtual environment
- cd into the repo
- Run "flask resetdb"
- Run "flask add"
- Go to "http://127.0.0.1:5000/" in your browser
- You should see a JSON object - if you do, then it worked!
Response formats: JSON
Requires authentication: No
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
start_date | No | Start date of keystrokes (inclusive) | None | 2019-08-05 |
end_date | No | End date of keystrokes (inclusive) | None | 2019-08-07 |
limit | No | Limit on how many keystrokes to return (ordered by most recent) | None | 100 |
If no parameters are given, the default is to return all the keystrokes.
http://127.0.0.1:5000?start_date=2019-08-05&end_date=2019-08-07
This returns all the keystrokes between 2019-08-05 and 2019-08-07 inclusive.
http://127.0.0.1:5000?start_date=2019-08-05
This returns all the keystrokes after 2019-08-05 (inclusive).
http://127.0.0.1:5000?end_date=2019-08-07
This returns all the keystrokes before 2019-08-07 (inclusive).
http://127.0.0.1:5000?limit=100 This returns the last 100 keystrokes.
http://127.0.0.1:5000
This returns all the keystrokes in the database.