nech-api is RESTful api to log your doctors nech. Nech-api is written using nodejs, express, and mongodb.
a demo is available at https://nech-api.herokuapp.com/.
Using HTTPie:
- Register to the service
$ http POST https://nech-api.herokuapp.com/auth/register username=[user] password=[password]
- Get your login token
$ http POST https://nech-api.herokuapp.com/auth/login username=[user] password=[password]
- Validate your token is working
$ http GET https://nech-api.herokuapp.com/users/me 'Authorization:Bearer [yourtoken]'
- Post a nech
$ http POST https://nech-api.herokuapp.com/nechs/nech 'Authorization:Bearer [yourtoken]'
- Get all logged nechs
$ http GET https://nech-api.herokuapp.com/nechs
All post values must be valid JSON.
Returns status information of the API.
Registers a new account.
Parameter | Example | Description |
---|---|---|
username | johndoe | the username you want to register |
password | s3cretW0rd | your desired password (must be at least 8 characters long) |
Returns an access token.
Parameter | Example | Description |
---|---|---|
username | johndoe | your registered username |
password | s3cretW0rd | your matching password |
Sends a verification code to the specified email.
Parameter | Example | Description |
---|---|---|
username | johndoe | your registered username |
[email protected] | the email address you want to verify |
Verifies your email address
Returns all logged nechs.
Returns the nech specified by id.
Auth required
Logs a new nech.
Auth required
Logs a new trivial.
Auth required
Logs a new klar.
Returns a list of all users.
Returns a user specified by the username.
Returns all logged nechs/klars/trivials by the user.
Returns all logged nechs by the user.
Returns all logged klars by the user.
Returns all logged trivials by the user.
Auth required
Returns the currenty logged in user.
Returns all lessons.
Moderator required
Posts a new lesson.
Parameter | Example | Description |
---|---|---|
type | LA | Must be either LA or ANA |
from | 2018-04-01T08:00:00 | The starting date |
to | 2018-04-01T09:30:00 | The ending date |
Returns the next lesson.
Returns a lesson by id.