-
Notifications
You must be signed in to change notification settings - Fork 4
/
endpoints.txt
139 lines (129 loc) · 2.55 KB
/
endpoints.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Spec sheet for the endpoints required.
1. /count
request: { }
response: {
status: 0,
data: {
people: 123,
trips: 44
}
}
response: {
status: 1,
error: "Unable to run select in DB"
}
2. /email
request: {
to: "[email protected]",
subject: "Hello",
content: "Hello"
}
response: {
status: 1,
data: {
errorMsg: "Could not be sent. Server error."
}
}
3. Trip
1) /getTrip
request: {
trip_id: 13
}
response: {
status: 0,
data: { // No idea why this was called data -_-
tripId: 01,
... (All details about !!latest!! trip of currently logged in user)
}
}
response: {
status: 1,
error: "Unable to run select in DB" | "Duplicate id in DB" | "Invalid session"
}
2) /getLatestTrip
request: {}
response: {
status:0,
data: {
tripId: 01,
... (All details about !!latest!! trip of currently logged in user)
}
}
response: {
status: 1,
error: "Unable to run select in DB" | "Invalid session"
}
3) /getAllTrips
request: {}
response: {
status:0,
data: {
[
{ trip 1 },
{ trip 2 },
...
]
}
}
response: {
status: 1,
error: "Unable to run select in DB" | "Invalid session"
}
4) /getPublicTrips
request: {}
response: {
status:0,
data: {
[
{ trip 1 },
{ trip 2 },
...
]
}
}
response: {
status: 1,
error: "Unable to run select in DB" | "Invalid session"
}
4. /matchTrip
// You cannot send requests to matchTrip anymore.
// And there is no response.
response: {
status: 0,
data: {
[
{ trip 1 },
{ trip 2 }, // These trips must be in same format as /getTrip's response["data"]
{ trip 3 }
] // This array can be of len 0 as well.
}
}
response: {
status: 1,
error: "Unable to run query in DB" | "Duplicate id in DB" | "Invalid session"
}
5. /addTrip
request: {
source_addr: "String",
dest_addr: "String",
date: "String",
start_time: "String"
end_time: "String"
phone_number: "" or "String",
travellers: "String",
comments: "String",
private: "String" // It will have either Yes or No as value
}
response: {
status: 0,
data: {
message: "Added new trip"
tripId: 13
}
}
response: {
status: 1,
error: "Unable to insert into DB" | "Invalid session"
}
6. /editTrip
// Need to add.