
Restful Blog API with jwt authentication.
- Create and Follow blogs.
- Add posts to their blogs.
- Like and Comment to posts.
- Add tags to their posts.
- Change profile picture
- Change username
| Method |
Route |
| POST |
/api/auth/signup |
| POST |
/api/auth/signin |
| POST |
/api/auth/signout |
| POST |
/api/auth/refreshToken |
| Method |
Route |
| GET |
/api/user |
| POST |
/api/user/change-profile-photo |
| POST |
/api/user/change-username |
| DELETE |
/api/user/remove-profile-photo |
| GET |
/api/user/users-list |
| Method |
Route |
| GET |
/api/adminontroller/suspend-user/{username} |
| GET |
/api/adminontroller/unsuspend-user/{username} |
| Method |
Route |
Description |
| GET |
/api/blogs/ |
Get all blogs |
| GET |
/api/blogs/{id} |
Get blog by id |
| POST |
/api/blogs |
Create new blog |
| PUT |
/api/blogs/{id} |
Update blog |
| DELETE |
/api/blogs/{id} |
Delete blog |
| GET |
/api/blogs/{id}/followers |
Get blog by id |
| POST |
/api/blogs/{id}/follow |
Follow blog |
| POST |
/api/blogs/{id}/unfollow |
Unfollow blog |
| GET |
/api/blogs/followed-blogs |
Get followed blogs |
| Method |
Route |
Description |
| GET |
/api/posts |
Get all posts certain Blog |
| GET |
/api/posts/{postId} |
Get post by id |
| POST |
/api/posts |
Add new post |
| PUT |
/api/posts/{postId} |
Update post |
| DELETE |
/api/posts/{postId} |
Delete post |
| POST |
/api/posts/{postId}/like |
Like a post |
| POST |
/api/posts/{postId}/unlike |
Remove like of a post |
| GET |
/api/posts/{postId}/likes |
Get all likes by postId |
Comments
| Method |
Route |
Description |
| GET |
/api/comments |
Get all comments of a certain Post |
| POST |
/api/comments |
Add new comment |
| PUT |
/api/comments/{commentId} |
Update a commment |
| DELETE |
/api/comments/{commentId} |
Delete a comment |
| POST |
/api/comments/{commentId}/like |
Like a comment |
| POST |
/api/comments/{commentId}/unlike |
Remove like of a commment |
| Method |
Route |
Description |
| GET |
/api/tags |
Get all tags |
| POST |
/api/tags |
Add new tag |
You can either register and login
or use any of the two seeded users :
- Email :
johndoe@gmail.com password : Passwd@123
- Email :
janedoe@gmail.com password : Passwd@123
- Email :
admin@gmail.com password : Passwd@123
to gain jwt access.
You can use with `curl` , postman or head to `https://localhost:7086/swagger/index.html`
Have fun! 😃
