-
Notifications
You must be signed in to change notification settings - Fork 0
'Like Post' Documentation
This API functionality likes the post likes of a given post id. The function for this endpoint is likePost(postId, username), existing in the file likes.py. This functionality utilizes POST requests in our API. It takes username and post id as a path parameter. It inserts the liked informations to likes database and update the number of likes field in posts database.
If you try this API in our AWS EC2 instance,use
http://ec2-35-158-103-6.eu-central-1.compute.amazonaws.com:5000/api/post/{postId}/likes/{username}
example: http://ec2-35-158-103-6.eu-central-1.compute.amazonaws.com:5000/api/post/5/likes/onurcanavci
If you try this API on our local machine, use
http://localhost:5000/api/post/{postId}/likes/{username}
example: http://localhost:5000/api/post/5/likes/onurcanavci
Note that this functionality works only with GET requests. To test this API, you can use the following valid post ids and username (postId, username):
- 1, onurcanavci
- 2, atainan
- 3, onurcanavci
- 4, ryan
These parameters are taken in the URL.
postId -> post id of the post which user willing to see post likes
username -> username of the likes post which user willing to like post
HTTP_200_OK -> Returns ‘Post liked Successfully’ indicating that the post liked successfully.
- Example Response
{
message: "Post liked successfully",
status: 200
}
HTTP_200_OK -> Returns ‘Like is reverted’ indicating that the post like reverted successfully.
- Example Response
{
message: "Like is reverted",
status: 200
}
HTTP_404_NOT_FOUND -> Post with given post id does not found in the post database.
- Example Response
{
"error": "Post is not found"
}
{"error":"Post is not found"}
HTTP_404_NOT_FOUND -> User with given username does not found in user database.
- Example Response
{
"error": "User is not found"
}
{"error":"User is not found"}
🏡 Home
- Research Similar Projects
- Requirements
- Questions
- Scenarios and Mockups
- Design
- Project Plan
- RAM
- API Documentation
- 451 API Documentation
- Manuals
- Reports
- Abdulkadir Elmacı
- Yağız Efe Şabanoğlu
- Erencan Uysal
- Hamza Akyıldız (451 Communicator)
İsmail Ata İnan (352 Communicator)- Merve Rabia Barın
- Onur Can Avcı
- Ramazan Bulut
- Umut Kocasarı