This repository implements the backend of the RECares 2020 project.
Users receive an authentication token upon signing in or registering for an account. They can then use this token to identify themselves by adding the following headers to their requests:
X-User-Email alice@example.com
X-User-Token Gp7NKBd8-wgXqazx-cuk
An alternative method is passing them in as query parameters.
https://secure.example.com?user_email=alice@example.com&user_token=1G8_s7P-V-4MGojaKD7a
You can even mix and match these methods if you really wanted to (please don't).
POST /users
{
"user": {
"email": "alice@example.com",
"password": "foobar"
}
}{
"id": 1,
"email": "alice@example.com",
"created_at": "2020-09-02T22:25:57.282Z",
"updated_at": "2020-09-02T22:25:57.282Z",
"authentication_token": "Gp7NKBd8-wgXqazx-cuk"
}POST /users/sign_in
{
"user": {
"email": "alice@example.com",
"password": "foobar"
}
}{
"id": 1,
"email": "alice@example.com",
"created_at": "2020-09-02T22:28:19.210Z",
"updated_at": "2020-09-02T22:28:19.210Z",
"authentication_token": "1QMU_xuspnHL3uMvVyyq"
}DELETE /users/sign_out
This request does not have a body.
200 OK
GET /site_modules/:the_module_name
Example: GET /modules/passwords
This request does not have a body.
The module data as a JSON dictionary.
GEt /site_modules
This request does not have a body.
[
{
"id": 1,
"name": "Passwords",
"created_at": "2020-09-04T00:48:09.372Z",
"updated_at": "2020-09-04T00:48:09.372Z"
}
]