This project is a complete backend of any social media project. It contains all the necessary functionality that a social media needs. If you need additional functionality, feel free to add them accordingly!
Note: Update the settings file before running the project.
This project contains the following features along with an admin panel and API's.
- Authentication: Ability to register, login, change password, reset password, verify email address and logout. It contains the following API's.
- Login API
- Logout API
- Register API
- Change Password API
- Reset Password API
- Reset Password Confirmation API
- Email Verify API
- Email Verification Confirmation API
- Profile Management: Ability to view profile, update language, country, religion and profile picture. It contains the following API's.
- Get Profile API
- Update Country API
- Update Language API
- Update Religion API
- Update Profile Picture API
- Feedback: The users will be able to write feedback and give rating about the experience of the application and suggest desired improvements and report bug. It ha one API.
- Post Feedback API
- Report a Bug API
- Configuration: The admin will be able to set the available countries, religions and languages via the admin panel. It has 3 API's for the application.
- Get All Countries API
- Get All Languages API
- Get All Religions API
- Friend: Ability to perform all friend related functionality.
- Send Friend Request API
- Get All Friends API
- Get All Sent Request API
- Get All Received Request API
- Accept Friend Request API
- Cancel Friend Request API
- Reject Friend Request API
- Friend Suggestions API
- Search Friend API
- Un-Friend API
- Block User API
- Un-Block User API
- Get All Blocked User API
- Feed: Ability to post, like, comment and view other's post.
- Create Post API
- Update Post API
- Delete Post API
- Get All My Posts API
- Get Post Details API
- Get My Feed API
- Like Post API
- Add Comment API
- Edit Comment API
- Delete Comment API
- Like Comment API
Attribute | Data Type |
---|---|
ID | Integer |
Password | String |
First name | String |
Last name | String |
Country | String |
Language | String |
Religion | String |
Avatar | Image Field |
Date Joined | Date Time |
Last Login | Date Time |
Is Active | Boolean |
Is Staff | Boolean |
Attribute | Data Type |
---|---|
Key | String |
Date Created | Date Time |
Attribute | Data Type |
---|---|
ID | Integer |
Country | String |
Attribute | Data Type |
---|---|
ID | Integer |
Language | String |
Attribute | Data Type |
---|---|
ID | Integer |
Religion | String |
Attribute | Data Type |
---|---|
ID | Integer |
Feedback Provider | Foreign Key to User Model |
Feedback | Text Field |
Rating | Decimal Fields |
Date Posted | Date Time |
Attribute | Data Type |
---|---|
ID | Integer |
Bug Reporter | Foreign Key to User Model |
Bug Information | Text Field |
Date Posted | Date Time |
Attribute | Data Type |
---|---|
ID | Integer |
Sender | Foreign Key to User Model |
Receiver | Foreign Key to User Model |
request Send Date | Date Time |
Attribute | Data Type |
---|---|
ID | Integer |
User 1 | Foreign Key to User Model |
User 2 | Foreign Key to User Model |
request Accept Date | Date Time |
Attribute | Data Type |
---|---|
ID | Integer |
Blocker | Foreign Key to User Model |
Blocked | Foreign Key to User Model |
Block Date | Date Time |
Attribute | Data Type |
---|---|
Post | TextField |
date Created | Date Time |
Is Edited | Boolean |
Date Edited | Date Time |
Author | Foreign Key to User Model |
Attachment | File Field |
Post Privacy | String |
Likes | Foreign Key to User Model |
Attribute | Data Type |
---|---|
Post | Foreign Key to Post Model |
Comment | TextField |
date Created | Date Time |
Is Edited | Boolean |
Date Edited | Date Time |
Author | Foreign Key to User Model |
Attachment | File Field |
Likes | Foreign Key to User Model |
- URL endpoint: api/account/auth/verify-email/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "hello@gmail.com" }
- Response:
or
{ "success": "An email with a verification code is sent to the email." }
or{ "error": "This email is already taken.", "details": [ "email: Email already taken. Please provide a unique email." ] }
{ "error": "Invalid request format.", "details": [ "email: This field is required." ] }
- URL endpoint: api/account/auth/confirm-email-verification/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "hello@gmail.com", "verification_code": "XMPQUE" }
- Response:
or
{ "detail": "Success! Email is verified." }
or{ "error": "Security code invalid or expired./Email and token mismatch.", "details": [ "The code you provided is invalid. Please provide a valid code." ] }
{ "error": "Invalid request format.", "details": [ "email: This field is required." ] }
- URL endpoint: api/account/auth/register/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "hello@gmail.com", "first_name": "Hello", "last_name": "Gello", "password": "HelloGello" }
- Response:
or
{ "id": 4, "email": "hello@gmail.com", "first_name": "Hello", "last_name": "Gello", "auth_token": "e7f08c4767cd9bec14f53239ee18665db82e80e8", "date_joined": "2021-01-22T17:35:06.867862Z", "country": "", "language": "", "religion": "", "avatar": null }
or{ "error": "Invalid email or password.", "details": [ "The email and password do not match. Please try with a valid combination." ] }
{ "error": "Invalid request format.", "details": [ "email: This field is required.", "password: This field is required." ] }
- URL endpoint: api/account/auth/login/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "myemail@gmail.com", "password": "mypassword" }
- Response:
or
{ "id": 2, "email": "hello@hello.com", "first_name": "Hello", "last_name": "Gello", "auth_token": "823397948b3770b8fe7c5b5bc5225fe9d7a4bfba", "date_joined": "2021-01-22T16:59:08.649053Z", "country": "Bangladesh", "language": "English", "religion": "Islam", "avatar": "/media/profile_pictures/404_Error_Page_not_Found_with_people_connecting_a_plug-bro.png" }
or{ "error": "Invalid email or password.", "details": [ "The email and password do not match. Please try with a valid combination." ] }
{ "error": "Invalid request format.", "details": [ "email: This field is required.", "password: This field is required." ] }
- URL endpoint: api/account/auth/logout/
- Authentication required: True (add "Authorization: Token your-token-here" to the request header)
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! You have been logged out." }
{ "detail": "Authentication credentials were not provided./Invalid token." }
- URL endpoint: api/account/auth/change-password/
- Authentication required: True
- Request method: POST
- Request:
{ "current_password": "hello", "new_password": "buddy", "new_password_2": "buddy" }
- Response:
or
{ "detail": "Success! Password change successful!/Authentication credentials were not provided." }
{ "error": "New passwords do not match.", "details": [ "Please provide same password for both new password fields." ] }
- URL endpoint: api/account/auth/reset-password/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "hello@example.com" }
- Response:
or
{ "detail": "Success! You will receive an email shortly if you are registered. Check your inbox for password reset token." }
{ "error": "Invalid request format.", "details": [ "email: This field is required." ] }
- URL endpoint: api/account/auth/confirm-password-reset/
- Authentication required: False
- Request method: POST
- Request:
{ "email": "hello@gmail.com", "token": "ABCDEF", "new_password": "abcdef", "new_password_2": "abcdef" }
- Response:
or
{ "detail": "Success! Password reset successful. Please login with your new password." }
{ "error": "Security code invalid or expired.", "details": [ "The code you provided is invalid. Please provide a valid code." ] }
- URL endpoint: api/account/profile/get-profile/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "id": 2, "email": "hello@hello.com", "first_name": "Hello", "last_name": "Gello", "auth_token": "43a6e82e4304cef1f83e1b939b522293233d59a6", "date_joined": "2021-01-22T16:59:08.649053Z", "country": "Bangladesh", "language": "English", "religion": "Islam", "avatar": "/media/profile_pictures/404_Error_Page_not_Found_with_people_connecting_a_plug-bro.png" }
{ "detail": "Authentication credentials were not provided./Invalid token." }
- URL endpoint: api/account/profile/update-country/
- Authentication required: True
- Request method: POST
- Request:
{ "value": "United States" }
- Response:
{ "detail": "Success! Country has been updated./Error! Something went wrong. Please try again later." }
- URL endpoint: api/account/profile/update-language/
- Authentication required: True
- Request method: POST
- Request:
{ "value": "Chinese" }
- Response:
{ "detail": "Success! Language has been updated./Error! Something went wrong. Please try again later." }
- URL endpoint: api/account/profile/update-religion/
- Authentication required: True
- Request method: POST
- Request:
{ "value": "Christian" }
- Response:
{ "detail": "Success! Religion has been updated./Error! Something went wrong. Please try again later." }
- URL endpoint: api/api/account/profile/update-avatar/
- Authentication required: True
- Request method: POST
- Request:
{ "avatar": "<File as multipart form data>" }
- Response:
or
{ "detail": "Success! Profile picture has been updated.", "avatar": "/media/profile_pictures/3.jpg" }
{ "detail": "Error! Something went wrong. Please try again later.", "avatar": "" }
- URL endpoint: api/configuration/all-countries/
- Authentication required: False
- Request method: GET
- Request: None
- Response:
or
{ "countries": [] }
{ "countries": [ { "id": 2, "country": "Bangladesh" }, { "id": 3, "country": "Canada" }, { "id": 1, "country": "USA" } ] }
- URL endpoint: api/configuration/all-languages/
- Authentication required: False
- Request method: GET
- Request: None
- Response:
or
{ "languages": [] }
{ "languages": [ { "id": 2, "language": "Bengali" }, { "id": 1, "language": "English" } ] }
- URL endpoint: api/configuration/all-religions/
- Authentication required: False
- Request method: GET
- Request: None
- Response:
or
{ "religions": [] }
{ "religions": [ { "id": 2, "religion": "Christian" }, { "id": 1, "religion": "Islam" } ] }
- URL endpoint: api/feedback/post-feedback/
- Authentication required: True
- Request method: POST
- Request:
{ "feedback": "Your app is awsome. Keep it up!", "rating": 5 }
- Response:
{ "detail": "Success! Thanks for your feedback. Your feedback has been sent to the authority." }
or{ "detail": "Error! Something went wrong. Please try again later." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/feedback/report-bug/
- Authentication required: True
- Request method: POST
- Request:
{ "bug_information": "Please fix the bug in chat!" }
- Response:
{ "detail": "Success! Thanks for reporting the issue. Your concern has been sent to the authority." }
or{ "detail": "Error! Something went wrong. Please try again later." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/send-friend-request/<user_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
{ "detail": "Success! Friend request sent." }
or{ "detail": "Error! Receiver does not exists./Error! You can not send friend request to yourself./You have already sent a friend request to this person." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/get-all-friends/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "all_friends": [ { "friend": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "friend_since": "2021-02-15T13:51:37.757921Z" }, { "friend": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "friend_since": "2021-02-15T13:51:46.315257Z" }, { "friend": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "friend_since": "2021-02-15T14:00:22.836795Z" } ] }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/get-all-sent-request/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "all_sent_requests": [ { "id": 1, "receiver": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "request_send_date": "2021-02-15T13:41:22.346349Z" }, { "id": 2, "receiver": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "request_send_date": "2021-02-15T14:31:32.990444Z" } ] }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/get-all-received-request/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "all_received_requests": [ { "id": 3, "sender": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "request_send_date": "2021-02-15T14:42:04.875113Z" }, { "id": 4, "sender": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "request_send_date": "2021-02-15T14:42:11.156738Z" } ] }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/un-friend/<user_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! You have been un-friend." }
or{ "detail": "Error! you are not friend with this person." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/accept-friend-request/<request_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! Friend request accepted." }
or{ "detail": "Error! Friend request does not exist." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/reject-friend-request/<request_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! Friend request rejected." }
or{ "detail": "Error! Friend request does not exist." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/cancel-friend-request/<request_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! Friend request cancelled." }
or{ "detail": "Error! Friend request does not exist." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/friend-suggestions/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "suggestions": [ { "id": 6, "email": "mdnyrr22222eza@gmail.com", "first_name": "d", "last_name": "d", "country": "Australia", "language": "English", "religion": "islam", "avatar": null }, { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null } ] }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/search-people/
- Authentication required: True
- Request method: POST
- Request:
{ "search_keyword": "kaykobad" }
- Response:
or
{ "search_result": [ { "user": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "is_friend": true }, { "user": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "is_friend": false }, { "user": { "id": 5, "email": "kaykobad.reza@bkash.com", "first_name": "f", "last_name": "f", "country": "Bangladesh", "language": "English", "religion": "Islam", "avatar": null }, "is_friend": false } ] }
or{ "detail": "Error! Something went wrong. Please try again later." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/block/<user_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! User is blocked." }
or{ "detail": "Error! User does not exist./Error! You can not block yourself." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/unblock/<user_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! User is unblocked." }
or{ "detail": "Error! Blocked user does not exist." }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/friends/get-blocked-users/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "blocked_users": [ { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, { "id": 4, "email": "user1234@gmail.com", "first_name": "H", "last_name": "P", "country": "Bangladesh", "language": "English", "religion": "Islam", "avatar": null } ] }
{ "detail": "Authentication credentials were not provided." }
- URL endpoint: api/feed/create-post/
- Authentication required: True
- Request method: POST
- Request:
{ "post": "This is my first post. Hope you like it!" }
- Response:
or
{ "id": 1, "post": "This is my first post. Hope you like it!", "date_created": "2021-02-18T15:18:32.934753Z", "is_edited": false, "date_edited": null, "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 0, "total_comments": 0, "attachment": null, "post_privacy": "friends" }
{ "detail": "Error! Something went wrong. Please try again later." }
- URL endpoint: api/feed/update-post/<post_id>/
- Authentication required: True
- Request method: POST
- Request:
{ "post": "This is my updated second post. Hope you like it too!" }
- Response:
or
{ "id": 2, "post": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-18T15:21:37.336042Z", "is_edited": true, "date_edited": "2021-02-19T04:33:57.477683Z", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 2, "total_comments": 2, "attachment": null, "post_privacy": "friends", "comments": [ { "id": 1, "comment": "This is my first updated comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:04.054386Z", "is_edited": true, "date_edited": "2021-02-19T04:11:15.009832Z", "attachment": null, "total_likes": 1 }, { "id": 2, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:11.572011Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 1 } ] }
{ "detail": "Error! No post found. Make sure you are the author of the post and try with a valid post id." }
- URL endpoint: api/feed/my-posts/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "posts": [ { "id": 1, "post": "This is my first post. Hope you like it!", "date_created": "2021-02-18T15:18:32.934753Z", "is_edited": false, "date_edited": null, "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 0, "total_comments": 0, "attachment": null, "post_privacy": "friends" }, { "id": 2, "post": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-18T15:21:37.336042Z", "is_edited": true, "date_edited": "2021-02-18T16:51:27.678950Z", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 0, "total_comments": 0, "attachment": null, "post_privacy": "friends" } ] }
{ "detail": "Error! No post found. Make sure you are the author of the post and try with a valid post id." }
- URL endpoint: api/feed/delete-post/<post_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! Post deleted from database." }
{ "detail": "Error! Post does not exist." }
- URL endpoint: api/feed/post-details/<post_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "id": 2, "post": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-18T15:21:37.336042Z", "is_edited": true, "date_edited": "2021-02-19T04:33:57.477683Z", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 2, "total_comments": 2, "attachment": null, "post_privacy": "friends", "comments": [ { "id": 1, "comment": "This is my first updated comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:04.054386Z", "is_edited": true, "date_edited": "2021-02-19T04:11:15.009832Z", "attachment": null, "total_likes": 1 }, { "id": 2, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:11.572011Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 1 } ] }
{ "detail": "Error! Post does not exist." }
- URL endpoint: api/feed/like-post/<post_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "detail": "Success! You liked/unliked the post." }
{ "detail": "Error! Post does not exist./Error! You already liked the post." }
- URL endpoint: api/feed/my-feed/
- Authentication required: True
- Request method: GET
- Request: None
- Response:
or
{ "posts": [ { "id": 3, "post": "This is a post for the app! Like it, if you like it.", "date_created": "2021-02-19T03:53:22.046432Z", "is_edited": false, "date_edited": "2021-02-19T03:53:05Z", "author": { "id": 2, "email": "kaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "United States", "language": "Chinese", "religion": "Islam-Sunni", "avatar": "/media/profile_pictures/reza.jpg" }, "total_likes": 0, "total_comments": 0, "attachment": null, "post_privacy": "friends" }, { "id": 4, "post": "This is a post for the app! Like it, if you like it.", "date_created": "2021-02-19T03:53:37.831118Z", "is_edited": true, "date_edited": "2021-02-19T03:53:25Z", "author": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 0, "total_comments": 0, "attachment": null, "post_privacy": "friends" } ] }
{ "detail": "Error! Something went wrong. Please try again later." }
- URL endpoint: api/feed/add-comment/
- Authentication required: True
- Request method: POST
- Request:
{ "post_id": 1, "comment": "This is my first comment for testing." }
- Response:
or
{ "id": 2, "post": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-18T15:21:37.336042Z", "is_edited": true, "date_edited": "2021-02-18T17:24:25.163796Z", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 1, "total_comments": 2, "attachment": null, "post_privacy": "friends", "comments": [ { "id": 1, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:04.054386Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 0 }, { "id": 2, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:11.572011Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 0 } ] }
{ "detail": "Could not comment. Invalid post id or comment format." }
- URL endpoint: api/feed/update-comment/<comment_id>/
- Authentication required: True
- Request method: POST
- Request:
{ "comment": "This is my first comment for testing." }
- Response:
or
{ "id": 2, "post": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-18T15:21:37.336042Z", "is_edited": true, "date_edited": "2021-02-18T17:24:25.163796Z", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 1, "total_comments": 2, "attachment": null, "post_privacy": "friends", "comments": [ { "id": 1, "comment": "This is my first updated comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:04.054386Z", "is_edited": true, "date_edited": "2021-02-19T04:11:15.009832Z", "attachment": null, "total_likes": 0 }, { "id": 2, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 2, "post_text": "This is my updated second post. Hope you like it too!", "date_created": "2021-02-19T04:06:11.572011Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 0 } ] }
{ "detail": "No comment found. Make sure you are the author of the comment." }
- URL endpoint: api/feed/delete-comment/<comment_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
or
{ "id": 4, "post": "This is a post for the app! Like it, if you like it.", "date_created": "2021-02-19T03:53:37.831118Z", "is_edited": true, "date_edited": "2021-02-19T03:53:25Z", "author": { "id": 3, "email": "abcdkaykobadreza@gmail.com", "first_name": "Kaykobad", "last_name": "Reza", "country": "", "language": "", "religion": "", "avatar": null }, "total_likes": 0, "total_comments": 2, "attachment": null, "post_privacy": "friends", "comments": [ { "id": 3, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 4, "post_text": "This is a post for the app! Like it, if you like it.", "date_created": "2021-02-19T04:06:26.529876Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 0 }, { "id": 4, "comment": "This is my first comment for testing.", "author": { "id": 1, "email": "admin@admin.com", "first_name": "", "last_name": "", "country": "", "language": "", "religion": "", "avatar": null }, "post_id": 4, "post_text": "This is a post for the app! Like it, if you like it.", "date_created": "2021-02-19T04:06:30.355880Z", "is_edited": false, "date_edited": null, "attachment": null, "total_likes": 0 } ] }
{ "detail": "Error! No comment found. Make sure you are the author of the comment and try with a valid comment id." }
- URL endpoint: api/feed/like-comment/<comment_id>/
- Authentication required: True
- Request method: POST
- Request: None
- Response:
{ "detail": "Success! You liked/unliked the comment." }
or
{ "detail": "Error! No comment found. Try with a valid comment id." }