2023-01-27 17:09:18 +01:00
|
|
|
# worklog
|
|
|
|
|
2023-02-02 10:03:55 +01:00
|
|
|
simple workday recording with a basic rest api
|
|
|
|
|
|
|
|
|
|
|
|
## endpoints
|
|
|
|
|
|
|
|
| method | url | arguments | description |
|
|
|
|
| ------ | --- | --------- | ----------- |
|
2023-02-02 12:48:05 +01:00
|
|
|
| `get` | /csv| from=DD.MM.YYYY<br>to=DD.MM.YYYY | get recordings (for specified range) as csv |
|
|
|
|
| `get` | /json| from=DD.MM.YYYY<br>to=DD.MM.YYYY | get recordings (for specified range) as json |
|
2023-02-02 10:03:55 +01:00
|
|
|
| `get` | /today | | get aggregated recordings for today as json (if any) |
|
2023-02-02 12:48:05 +01:00
|
|
|
| `get` | /overtime | | get aggregated overtime (for specified range) |
|
2023-02-02 10:03:55 +01:00
|
|
|
| `post` | /start | | start a new recording |
|
|
|
|
| `post` | /stop | | stop the current recording (if any) |
|
|
|
|
|
|
|
|
**note:**
|
|
|
|
the api uses basic authentication so each request has to include an `Authorization` request header.
|
|
|
|
|
|
|
|
## examples
|
|
|
|
|
|
|
|
**start a new recording:**
|
|
|
|
curl -X POST -u username:password http://localhost:3333/start
|
|
|
|
|
|
|
|
**stop the current recording:**
|
|
|
|
curl -X POST -u username:password http://localhost:3333/stop
|
|
|
|
|
|
|
|
**get all recordings as json:**
|
|
|
|
curl -u username:password http://localhost:3333/json
|
|
|
|
|
|
|
|
**get all recordings for january 2023 as csv:**
|
|
|
|
curl -u username:password http://localhost:3333/csv?from=01.01.2023&to=31.01.2023
|
|
|
|
|
|
|
|
## configuration
|
|
|
|
|
|
|
|
configuration is entirely done inside the file `config.yml`.
|
|
|
|
you can specify the location of the config file with the optional argument `--config` or `-c` when starting the server.
|
|
|
|
otherwise the program will try to find a config file at the following locations:
|
|
|
|
- `$HOME/.config/worklog/config.yml`
|
|
|
|
- `$PWD/config.yml`
|