A social media Rest API that enables authenticated users to create, edit and delete posts made by them. Further, it enables registered users to see each other posts and also follow and chat up each other.
- User creation
- Authentication
- User deletion
- API routes
- Posts creation, editing and deletion
- View posts
- Like and reply posts
- Real time notifications
- Chat service
- Follow/unfollow registered user(s)
BASE URL: https://cosocial-api.onrender.com/
POST /api/auth/sign-up
Parameter | Type | Description | Required |
---|---|---|---|
username |
string |
Username of user | Yes |
email |
string |
Email address of user | Yes |
password |
string |
Password of user | Yes |
POST /api/auth/login
Parameter | Type | Description | Required |
---|---|---|---|
email |
string |
Email address of user | Yes |
password |
string |
Password of user | Yes |
BASE URL: https://cosocial-api.onrender.com/
N.B: All users routes are protected
Authorization: bearer ${token}
GET /api/users
POST /api/users/all-users
GET /api/users/notifications
DELETE /api/users/notifications
PUT /api/users/notifications/read
PUT /api/users/n/unread
PUT /api/users/notifications/unread/:id
DELETE /api/users/notifications/:id
PATCH /api/user/update-password
Parameter | Type | Description | Required | Min-Length |
---|---|---|---|---|
oldPassword |
string |
Current password of user | Yes | 6 |
newPassword |
string |
New password of user | Yes | 6 |
GET /api/users/notfollowing
GET /api/users/nonfollowers
GET /api/users/nonfollowers
PUT /api/users/:id
Parameter | Type | Description | Required | Min-Length |
---|---|---|---|---|
email |
string |
Current password of user | No | 4 |
username |
string |
New password of user | Yes | 6 |
password |
string |
New password of user | Yes | 6 |
DELETE /api/users/:id
GET /api/users/:id
GET /api/users/:id/follow
GET /api/users/:id/unfollow
GET /api/users/:id/followers
GET /api/users/:id/following
BASE URL: https://cosocial-api.onrender.com/
N.B: All posts routes are protected
Authorization: bearer ${token}
POST /api/posts
Parameter | Type | Description | Required | Min-Length |
---|---|---|---|---|
description |
string |
Description | Yes | 1 |
image |
File |
Image | No | N/A |
GET /api/posts/bookmark
GET /api/posts/explore
GET /api/posts/user-posts/:id
PUT /api/posts/:id
Parameter | Type | Description | Required | Min-Length |
---|---|---|---|---|
description |
string |
Description | Yes | 1 |
image |
File |
Image | No | 6 |
DELETE /api/posts/:id
GET /api/posts/:id
PUT /api/posts/:id
GET /api/posts/:id/timeline
PUT /api/posts/:id/bookmark
PUT /api/posts/:id/reply
DELETE /api/posts/:id/reply
PUT /api/posts/:id/reply/like
BASE URL: https://cosocial-api.onrender.com/
N.B: All conversations routes are protected
Authorization: bearer ${token}
POST /api/conversations
Parameter | Type | Description | Required | Min-Length |
---|---|---|---|---|
senderId |
string |
ID of sender | Yes | 5 |
receiverId |
File |
ID of receiver | Yes | 5 |
text |
File |
Message Text | Yes | 1 |
GET /api/conversations/users
GET /api/conversations/:receiverId
Please visit this demo web app - Cosocial to see the API in action. Kindly note there may be a 10 or 15 seconds delay when calling the API for the first time or after one or two hours of inactivity.
If you have any feedback, please reach out to me via chisomije92@gmail.com