-
Notifications
You must be signed in to change notification settings - Fork 3
[SERVER] Requests
General Status Code:
10: Crash/Exception, View Error Log for Details
11: No JSON received
12: request not recognized
[zone]: gets zone information and updates users location
- POST: http://wifi-location.appspot.com/request/zone
- BODY: {"user_id" : 1, "mac_address" : "00:1f:45:64:17:d1" }
- RESPONSE:
{
"status" : 0,
"last_update": "just now",
"zone_name": "Galleria3_1"
"map_name": "/media/zonemaps/map1.png"
}
- STATUS:
0: success (zone name & id returned, user location updated)
1: user not found
2: zone not found (mac_address unknown)
3: map not found
[get list of friends] : ask server for a list of friends
-
BODY: {"user_id" : 1}
-
RESPONSE:
{
"status" : 0,
"friend_list":
[
{
"friend_name": "Alex",
"friend_location": "Galleria3_1",
"map_name": "/media/zonemaps/map1.png"
"last_update": "2 days ago"
},
{
"friend_name": "Catherine",
"friend_location": "unknown",
"map_name": "unknown"
"last_update": "2 days ago"
},
]
} -
STATUS:
0: success (list of friends returned)
1: user not found
2: user has no friends :(
[send friendship request] : sends the server a friendship request
-
BODY: {"user_id" : 1, "friend_id" : 2 }
-
RESPONSE:
{
"status" : 0,
"request_id": 33
} -
STATUS:
0: success (friendship request registered)
1: user not found
2: friend not found
3: duplication (request already existed)
4: user is adding him/herself
5: users are already friends
[check friend request] : ask the server for a list of friend request
-
POST: http://wifi-location.appspot.com/request/pending/friendships
-
BODY: {"user_id" : 1}
-
RESPONSE:
{
"status": 0,
"requests":
[
{
"friend_name": "Catherine",
"request_id": "44009"
},
{
"friend_name": "Alex",
"request_id": "45009"
}
]
} -
STATUS:
0: success (list of pending request fetched)
1: user not found
2: no request found