1. Getting started
This section allows you to like and dislike a certain post.
2. General use
API Path |
/API/post/like.php |
Request |
POST |
requires login |
true |
needs database |
true |
needs config |
true |
output |
JSON |
3. Input
Takes 1 POST parameter
post |
postid |
like |
to like or unlike a post |
3.1. postid
Id of the post that should be like or unliked
3.2. like
to either like or unlike a post
values:
-
'like'
-
'unlike'
4. Output
4.1. Default
The server will respond with the following JSON, if everything worked correctly
{
"success": true,
"likes": 1234(1)
}
| 1 | Number of likes after the user liked the post |
4.2. Error
4.2.1. Invalid like parameter
If the like parameter is invalid, the server will respond with the following JSON:
{
"error": "Invalid Request",
"cause": "like: "(1)
}
| 1 | 'like: + the value sent to the server |
4.2.2. Others:
{
"error" : (1)
}
| 1 | Error message |