Todo API

Backend API for todo application to manage todos, users and authentication

Authentication 6

Routes for user authentication including register, login, reset pasword etc

Description

Recover password using Africa’sTalking SMS API

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "email": "test@gmail.com" }
Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "email": "kevin@gmail.com", "password": "12345678" }
Description

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "name": "admin", "email": "admin@gmail.com" }
Description

Reset user password using token

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "password": "123456" }
Description

Update logged in user password, send in the body currentPassword and newPassword

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "currentPassword": "123456", "newPassword" : "1234567" }
Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "email": "web@gmail.com", "name" : "Konga World" }

Todos 5

Todos CRUD functionality

Description

Add new todo to database. Must be authenticated

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "title": "Well Taught", "description": "Read Poem", "status": "Not Completed", "user": "603543bb8c9e100015c5ddc1" }
Description

Delete todo from database

Headers
KeyValueDescription
Content-Typeapplication/json
Description

Fetch all todos from database

Headers
KeyValueDescription
Content-Typeapplication/json
Description

Get single Todo by ID

Headers
KeyValueDescription
Content-Typeapplication/json
Description

Update single todo in database

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "title": "Cooking Salad", "description": "Study french fries", "status": "Completed" }

Users 5

CRUD functionality for users only available for admins

Description

Add user to database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "name": " Blessing John", "email" : "hisk@gmail.com", "password": "123456" }
Description

Delete user from database(admin)

Headers
KeyValueDescription
Content-Typeapplication/json
Description

Get all users(admin)

Headers
KeyValueDescription
Content-Typeapplication/json
Description

Get single user by id (admin)

Headers
KeyValueDescription
Content-Typeapplication/json
Description

User user in database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json
Body
{ "name": "West John", "email" : "wesbt@gmail.com" }