Protocol Comment - GoryMoon/DIT076-Flow GitHub Wiki
##################################################
########## GET ALL COMMENT(S) (DEV) ##########
##################################################
GET localhost:8080/api/comment/
input: -
output: json [{
"ownerid":"123", // id of user who comment
"postid":"123", // id of post where commented
"id":"123", // id of comment
"nick":"abc", // nick of owner
"text":"abc", // text of comment
"time":timestamp // timestamp of when it was commented
}, ...]
status: 200 OK
##################################################
##################################################
########## GET COMMENT(S)(RELEASE) V3.2 ##########
##################################################
POST localhost:8080/api/comment/get/
input: json '{
"userid":"123", // userid must be valid user
"ownerid":"123", // ownerid of comment must match completely - 501 Not Implemented
"postid":"123", // id of post must match completely
"nick":"xnick", // nick of poster must contain this string - 501 Not Implemented
"groupid":"123", // post must be in this group - 501 Not Implemented
"text":"abc", // text of post must contain this string - 501 Not Implemented
"before":timestamp}, // get posts before - 501 Not Implemented
"after":timestamp}, // get posts after - 501 Not Implemented
"count":"10" // Max amount to get - 501 Not Implemented
}'
output: json [{
"ownerid":"123", // id of user who comment
"postid":"123", // id of post where commented
"id":"123", // id of comment
"nick":"abc", // nick of owner
"text":"abc", // text of comment
"status":"0", // Visibility setting for the comment. 0: Visible, 1: Hidden
"time":timestamp // timestamp of when it was commented
}, ...]
status: 200 OK
##################################################
##################################################
########## PUT COMMENT (RELEASE) V3.3 ##########
##################################################
PUT localhost:8080/api/comment/put/
input: json '{
"userid":"123", // userid must be valid user and have authority
"id":"123", // id of post
"text":"abc", // text of post - 501 Not Implemented
"status":"1" // status the post will have
}'
output: json '{
"ownerid":"123", // id of user who comments
"postid":"123", // id of the commented post
"id":"123", // id of comment
"nick":"abc", // nick of owner
"text":"abc", // text of comment
"status":"0", // Visibility setting for the comment. 0: Visible, 1: Hidden
"time":timestamp // timestamp of when it was commented
}'
status: 200 OK
##################################################
##################################################
########## POST COMMENT (RELEASE) V3.1 ##########
##################################################
POST localhost:8080/api/comment/post/
input: json '{
"userid":"123", // userid must be valid user
"postid":"123", // id of the commented post
"text":"abc", // text of post
"status":"0" // status the post will have - 501 Not Implemented
}'
output: json '{
"ownerid":"123", // id of user who comment
"postid":"123", // id of post where commented
"id":"123", // id of comment
"nick":"abc", // nick of owner
"text":"abc", // text of comment
"status":"0", // Visibility setting for the comment. 0: Visible, 1: Hidden
"time":timestamp // timestamp of when it was commented
}'
status: 200 OK
##################################################