-
Notifications
You must be signed in to change notification settings - Fork 0
/
rest_doc.txt
33 lines (26 loc) · 1004 Bytes
/
rest_doc.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
HOST/SERVER: 54....
PROTOCOL: HTTP
-----------------------------------------------
// INITIATE user registration - creates empty user profile, generates random PIN and sends
// that PIN over SMS to the user
== REQUEST ==
URL: /api/users/register
METHOD: POST
HEADER: "Content-Type: application/json"
POST DATA: { "deviceId" : String, "phoneNumber" : String } // Singapore phones: "+65..."
== RESPONSE ==
202 Accepted - if request validation passed (phone number and device id are properly formed)
400 Bad Request - if validation didn't pass
Other regular status codes also used like
500 - Internal Server Error
------------------------------------------------
// VERIFY user registration - verifies user supplied PIN and completes user registration
== REQUEST ==
URL: /api/users/verify
METHOD: POST
HEADER: "Content-Type: application/json"
POST DATA: { "deviceId" : String, "pin" : Integer }
== RESPONSE ==
200 OK - if pin matched
... otherwise
-------------------------------------------------