Skip to content

Instantly share code, notes, and snippets.

@nevivurn
Last active Feb 26, 2019
Embed
What would you like to do?
/api
/group:
GET: list of groups and my relation to group
200:
[{
"idx": 1, "name": {"ko": "korean name", "en": "english name"}, "description": {"ko": "kor desc", "en": "en desc"},
"is_pending": false,
"is_member": true,
"is_owner": true
}, {...}]
401: not logged in
/group/123/apply:
POST: apply to group 123
200: success
400: errors, eg. already applied, invalid group, etc.
401: not logged in
/group/123/pending:
GET: list applications for group 123
200:
[{
"uid": 1, "username": "hong ggildong"
}, {...}]
401: if not owner
400: errors, eg. invalid group, etc.
/group/123/members:
GET: list of members in group 123
same as applications
(check if this returns 200 instead of a dedicated check-ownership endpoint?)
/group/123/accept:
POST: accept some applications for group 123
[1,2,3,4,44]
200: success
400: error on at least one approval
401: if not owner
/group/123/reject:
POST: reject some applications
same as group/accept
/group/123/leave:
POST: leave a group
200: success
400: errors, eg. not in group, etc.
all endpoints 401 if not logged in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment