This is LiTHe kod's user database.
git clone [email protected]:lithekod/user-database.git
cd user-database
make
Most of the functionality is available at the website. To add new email templates, simply push them to the emails repo and they will show up on the website.
If you want to access the database from the commandline or do development, you have to use the API.
Endpoint | Description |
---|---|
/<link> |
Access generated links |
/add_member/ |
Add member to database |
/modify/ |
Modify member data |
/email_members/ |
Send emails to members |
/email_list/ |
Get an email list |
/members/ |
Get all or individual members |
/member_count/ |
Get number of total and active members |
Access generated links. They look something like SHOW_hahu928bo
and are best
opened in the browser.
https://lithekod.lysator.liu.se/SHOW_hahu928bo
Add a member to to database.
Parameters | Description | Required |
---|---|---|
id |
Liu-id | yes |
name |
Full name | yes |
email |
no | |
joined |
ISO-Date (YYYY-mm-dd) | no |
subscribed |
Subscription status (0 or 1) | no |
$ curl -u :SECRET_KEY "https://lithekod.lysator.liu.se/add_member/?id=liuid123&name=Lius+Idus"
Successfully added user with id: liuid123.
Modify member data. The modifiable fields are the parameters to /add_member/
.
Parameters | Description | Required |
---|---|---|
id |
Liu-id | yes |
field |
Field to modify | yes |
new |
New value | yes |
$ curl -u :SECRET_KEY "https://lithekod.lysator.liu.se/modify/?id=liuid123&field=name&new=Blargh"
Successfully set 'name' to 'Blargh' for 'liuid123'
Send emails to members. Receivers is one of default
, all
, inactive
or a
space separated list of liu-ids.
Parameters | Description | Required |
---|---|---|
receivers |
Receivers | yes |
subject |
Email subject | yes |
template |
The email to send | yes |
$ curl -u :SECRET_KEY "https://lithekod.lysator.liu.se/email_members/?receivers=liuid123&subject=test&template=general/welcome.tpl"
Emails are being sent!
Get an email list. Receivers are the same as for /email_members/
.
Parameters | Description | Required |
---|---|---|
receivers |
Receivers | yes |
$ curl -u :SECRET_KEY "https://lithekod.lysator.liu.se/email_list/?receivers=all"
[...] # A JSON list of the users, the format is unspecified.
Get all or individual members. Basically a dump of the database.
Parameters | Description | Required |
---|---|---|
id |
Liu-id | no |
$ curl -u :SECRET_KEY "https://lithekod.lysator.liu.se/members/"
[...] # A JSON list of the users and the links
Get number of total and active members. Does not require authentication.
$ curl "https://lithekod.lysator.liu.se/member_count/"
{"active_members":25,"total_members":110}