-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.txt
80 lines (68 loc) · 2.25 KB
/
api.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
===== users =====
get_user : gets info for one user
api/user/<netid>/
returns 404 if user not found
returns user info if found
delete_user : deletes the currently logged in user
api/delete_user/
returns 404 if user not found
returns "deleted user <netid>" if successful
get_events_for_user : gets the events the specified user has signed up for
api/get_events_for_user/<netid>/
returns empty list if no joined events
returns list of events if found
===== event =====
get_events : gets info for all events
api/get_events/
returns empty list if no joined events
returns list of events and event info if found, with "owner" field
get_event : gets info for the event specified by event_id
api/event/<event_id>/
returns 404 if event not found
returns event info if found
hosted_events : list of all events that the user <netid> has hosted
api/hosted_events/netid/
returns empty list if no events
returns event info if found
get_users_for_event : gets the signed up users for the specified event
api/get_users_for_event/<event_id>/
returns empty list if no users joined
returns list of Users if found
post_event : creates an event in the database
api/post_event/
takes in json input. must consist of fields:
"title"
"decscription"
"date" (yyyy-mm-dd)
"start" (hh:mm)
"end" (hh:mm)
"location"
"capacity"
returns event title if successful
delete_event : deletes the specified event
api/delete_event/<event_id>/
returns 404 if event not found
returns 403 Forbidden if not the correct user
returns "deleted event " + event id and title if successful
edit_event : edits a specified event
api/edit_event/<event_id>/
returns 404 if event not found
returns 403 Forbidden if not the correct user
returns "event <event_id> updated" if successful
===== join =====
join_event : joins the user to the event
/api/join_event/
takes in json input. must consist of fields:
"event" (event id pk)
returns 404 if event not found
returns 400 if event full
returns 400 if already joined
returns netid + "joined" + event + newatt if successful
unjoin_event : unjoins the user from the event
/api/unjoin_event/
takes in json input. must consist of fields:
"event" (event id pk)
returns 404 if event not found
returns 400 if event not joined
returns netid + "unjoined" + event + newatt if successful
===== login =====