Skip to content
catherinettt edited this page Jun 3, 2012 · 34 revisions

General Status Code:
10: Crash/Exception, View Error Log for Details
11: No JSON received
12: request not recognized
13: Request fail...


[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

  • POST: http://wifi-location.appspot.com/request/friendlist

  • BODY: {"user_id" : 1}

  • RESPONSE:
    {
    "status" : 0,
    "friend_list":
    [
    {
    "first_name": "Alex",
    "last_name": "Kwan",
    "friend_location": "Galleria3_1",
    "map_name": "/media/zonemaps/map1.png"
    "last_update": "2 days ago"
    },
    {
    "first_name": "Catherine",
    "last_name": "Tan",
    "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

  • POST: http://wifi-location.appspot.com/request/friendship

  • 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":
    [
    {
    "first_name": "Catherine",
    "last_name": "Tan",
    "request_id": "44009"
    },
    {
    "first_name": "Alex",
    "last_name": "Kwan",
    "request_id": "45009"
    }
    ]
    }

  • STATUS:
    0: success (list of pending request fetched)
    1: user not found
    2: no request found


[check near by events] : display super zone events, updates user location

  • POST: http://wifi-location.appspot.com/request/events

  • BODY: {"user_id" : 28001, "mac_address" : "00:1f:45:64:0f:41"}

  • RESPONSE:

    {
    "status": 0,
    "events":
    [
    { "description": null,
    "start_time": "Tue Jun 5 18:30:00 2012",
    "location": "SUR3360",
    "end_time": "Tue Jun 5 19:30:00 2012",
    "organizer": "[email protected]",
    "name": "Certificates in Management"
    },
    {
    "description": "The portfolio workshops is a peer programme returning from the summer semester designed to help SIAT students develop an industry-ready portfolio. The first workshop will focus on tips on how to develop different effective portfolios that best represent what you have to offer. Case studies of examples of strong portfolios will be brought in to show how and why they work. The second workshop will be an open peer-sharing of portfolios where we can learn from each other with a review session with experienced faculty. Leave the workshop with fresh ideas and an understanding of the principles behind a strong portfolio and what it takes to succeed as a designer. ",
    "start_time": "Tue Jun 5 17:30:00 2012",
    "location": "SUR3250",
    "end_time": "Tue Jun 5 20:30:00 2012",
    "organizer": "IATSU",
    "name": "Fall Portfolio Workshop Series"
    },

     ] <br>
    

    }

  • STATUS:
    0: success (user location updated, list of event returned)
    1: BSSID unknown

Clone this wiki locally