'Save Post' Documentation - bounswe/2021SpringGroup7 GitHub Wiki
It . It takes username as a path parameter and a json object containing post id. It updates the given user's saved posts list in the database.
This API functionality performs the saving operation of the user with given post id. The function for this endpoint is savePost(username), existing in the file savePost.py. This functionality utilizes POST request in our API.
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/{username}/savings
If you try this API on our local machine, use
http://localhost:5000/api/{username}/savings
Note that this functionality works only with POST requests.
These parameters are taken in the URL.
username:string -> username of the user that requested to save the post
These parameters are taken in json body.
postId:integer (required)
- Example Response
Successful Add
- Example Response
{
"error": "User not found"
}
{
"error": "Post not found"
}
- Example Response
{
"error": "Bad Request"
}