-
Notifications
You must be signed in to change notification settings - Fork 0
Protocol Post
zoizer edited this page Mar 2, 2018
·
8 revisions
##################################################
########## GET ALL POST(S) (DEV) ##########
##################################################
GET localhost:8080/api/post/
input: -
output: json [{
"ownerid":"123", // id of user who posted
"groupid":"123", // id of group the post was posted in
"id":"123", // id of post
"nick":"abc", // nick of owner
"title":"abc", // title of post
"text":"abc", // text of post
"time":timestamp // timestamp of when it was posted
}, ...]
status: 200 OK
##################################################
##################################################
########## GET POST(S) (RELEASE) V1.0 ##########
##################################################
GET localhost:8080/api/post/get/
input: json '{
"userid":"123", // userid must be valid user - 401 Not Implemented
"ownerid":"123", // ownerid of post must match completely - 401 Not Implemented
"groupid":"123", // post must be in this group - 401 Not Implemented
"nick":"xnick", // nick of poster must contain this string - 401 Not Implemented
"id":"123", // id of post must match completely - 401 Not Implemented
"title":"abc", // title of post must contain this string - 401 Not Implemented
"text":"abc", // text of post must contain this string - 401 Not Implemented
"before":timestamp}, // get posts at or before - 401 Not Implemented
"after":timestamp}, // get posts at or after - 401 Not Implemented
"count":"10" // Max amount to get - 401 Not Implemented
}'
output: json [{
"ownerid":"123", // id of user who posted
"groupid":"123", // id of group the post was posted in
"id":"123", // id of post
"nick":"abc", // Nick of owner
"title":"abc", // title of post
"text":"abc", // text of post
"time":timestamp // timestamp
}, ...]
status: 200 OK
##################################################
##################################################
########## PUT POST (RELEASE) V1.0 ##########
##################################################
GET localhost:8080/api/post/put/
input: json '{
"userid":"123", // userid must be valid user and have authority - 401 Not Implemented
"id":"123", // id of post to modify - 401 Not Implemented
"title":"abc", // title of post will be this string - 401 Not Implemented
"text":"abc", // text of post will be this string - 401 Not Implemented
"status":"hidden" // status the post will have - 401 Not Implemented
}'
output: json '{
"ownerid":"123", // id of user who posted
"groupid":"123", // id of group the post was posted in
"id":"123", // id of post
"nick":"abc", // Nick of owner
"title":"abc", // title of post
"text":"abc", // text of post
"time":timestamp // timestamp
}'
status: 200 OK
##################################################
##################################################
########## POST POST (RELEASE) V1.0 ##########
##################################################
GET localhost:8080/api/post/post/
input: json '{
"userid":"123", // userid must be valid user - 401 Not Implemented
"groupid":"123", // id of group the post will be posted in - 401 Not Implemented
"title":"abc", // title of post - 401 Not Implemented
"text":"abc", // text of post - 401 Not Implemented
"status":"visible" // status the post will have - 401 Not Implemented
}'
output: json '{
"ownerid":"123", // id of user who posted
"groupid":"123", // id of group the post was posted in
"id":"123", // id of post
"nick":"abc", // Nick of owner
"title":"abc", // title of post
"text":"abc", // text of post
"time":timestamp // timestamp of when it was posted
}'
status: 200 OK
##################################################