Protocol Group - GoryMoon/DIT076-Flow GitHub Wiki

##################################################
##########  GET ALL GROUP(S)      (DEV) ##########
##################################################
GET localhost:8080/api/group/
input: -
output: json [{
		"id":"123",		// id of group
		"name":"abc",		// name of group
		"status":"0",		// Membership status, 0: owner, 1: active member, 2: invited
		"time":timestamp	// timestamp
	}, ...] 
	status: 200 OK
##################################################

##################################################
##########  GET GROUP(S) (RELEASE) V3.1 ##########
##################################################
POST localhost:8080/api/group/get/
input:	json '{
		"userid":"123",		// userid must be valid user and member
		"ownerid":"123",	// ownerid of group must match completely
		"id":"123",		// id of group
		"name":"xgroup",	// name of group contains
		"before":timestamp},	// get groups before				- 501 Not Implemented
		"after":timestamp},	// get groups after				- 501 Not Implemented
		"count":"10"		// Max amount to get				- 501 Not Implemented
	}'
output:	json [{
		"id":"123",		// id of group
		"name":"abc",		// name of group
		"status":"0",		// Membership status, 0: owner, 1: active member, 2: invited
		"time":timestamp	// timestamp
	}, ...]
	status: 200 OK
##################################################

##################################################
##########  PUT GROUP    (RELEASE) V3.2 ##########
##################################################
PUT localhost:8080/api/group/put/
input:	json '{
		"userid":"123",		// userid must be valid user and owner
		"id":"123",		// id of group
		"name":"xgroup",	// new name of group
	}'
output:	json '{
		"id":"123",		// id of group
		"name":"xgroup",	// name of group
		"time":timestamp	// timestamp
	}'
	status: 200 OK
##################################################

##################################################
##########  POST GROUP   (RELEASE) V3.0 ##########
##################################################
POST localhost:8080/api/group/post/
input:	json '{
		"userid":"123",		// userid must be valid user
		"name":"xgroup",	// name of group
	}'
output:	json '{
		"id":"123",		// id of group
		"name":"xgroup",	// name of group
		"time":timestamp	// timestamp
	}'
	status: 200 OK
##################################################

##################################################
##########  JOIN GROUP   (RELEASE) V3.2 ##########
##################################################
POST localhost:8080/api/group/join/
input:	json '{
		"userid":"123",		// id of user
		"id":"123",		// id of group
	}'
output:	json '{
		"userid":"123",		// id of user
		"id":"123",		// id of group
		"nick":"apa",		// name of user
	}'
	status: 200 OK
##################################################

##################################################
########## LEAVE GROUP   (RELEASE) V3.1 ##########
##################################################
POST localhost:8080/api/group/leave/
input:	json '{
		"userid":"123",		// id of user who requests the membership termination
		"leaveid":"123",	// id of user
		"id":"123",		// id of group
	}'
output:	json '{
		"userid":"123",		// id of user whose membership has been terminated
		"id":"123",		// id of group
		"nick":"apa",		// nick name of user whose membership has been terminated
	}'
	status: 200 OK
##################################################

##################################################
########## INVITE GROUP  (RELEASE) V3.3 ##########
##################################################
POST localhost:8080/api/group/invite/
input:	json '{
		"userid":"123",		// userid must be valid user and owner
		"inviteid":"123",	// id of invited user
		"invitenick":apa",	// nickname of invited user
		"id":"123",		// id of group
	}'
output:	json '{
		"inviteid":"123",	// id of invited user
		"id":"123",		// id of group
		"nick":"apa",		// nickname of invited user
	}'
	status: 200 OK
##################################################