-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAPI_REFERENCE.txt
111 lines (73 loc) · 1.92 KB
/
API_REFERENCE.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
API Endpoints, request and response specification
--------
GET /
response format: string
"On-Off Index"
--------
GET /api
response format: string
"API Module"
--------------------
POST /api/verifyUser
request data:
{
"username":"some username",
"password":"some password"
}
response format: json
{
"match": "true|false", // if username/password matched db
"user_id": "corresponding user_id",
}
--------------------
POST /api/insertScan
request data:
{
"user_id": "some username",
"mode": "on|off",
"uuid": "temporary unique identifier for scan",
"date": "YYYY-MM-DD HH24:MM:SS",
"rte": "route id",
"dir": "direction id",
"lon": "longitude",
"lat": "latitude"
}
response format: json
{
"insertID": "id of created record",
"success": true|false,
"match" true|false // if mode == off, whether matching on scan was found
}
--------------------
POST /api/insertPair
request data:
{
"user_id": "some username",
"date": "YYYY-MM-DD HH24:MM:SS",
"rte": "route id",
"dir": "direction id",
"on_stop": "alighting stop id",
"off_stop": "boarding stop id",
"on_reversed": true|false, // if boarding stop direction is different than dir
"off_reversed": true|false, // if boarding stop direction is different than dir
}
response format: json
{
"insertID": id of created record,
"success": true|false
}
--------------------
POST /api/stopLookup
request data:
{
"rte": "route id",
"dir": "direction id",
"lon": "longitude",
"lat": "latitude"
}
response format: json
{
"error": true|false, // success of stop lookup
"stop_name": "stop name of nearest stop",
"stop_seq_rem": "number of stops until end of route"
}