STANZA API :

Live API ( all functional )

 



* GPS TRACKING API

** QUERIES

*** TOP-LEVEL INFO


#+BEGIN_SRC text

 /info

#+END_SRC


#+BEGIN_SRC javascript

 {"data" : {"type" : "info",

            "cities" : [id_1, id_2, ..., id_N],

            ...}}

#+END_SRC


*** CITY INFO


#+BEGIN_SRC text

 /city-info/<city_id>

#+END_SRC


#+BEGIN_SRC javascript

 {"data" : {"type" : "city",

            "city-id" : city_id,

            "name" : name_of_city,

            "devices" : [id_1, id_2, ..., id_N]}}

#+END_SRC


*** DEVICE INFO


#+BEGIN_SRC text

 /device-info/<device_id>

    NOTE: this should be ( and currently is )

    /device-info/<city_id>/<device_id>

    to be useful, may implement both *****

#+END_SRC


#+BEGIN_SRC javascript

 {"data" : {"type" : "device",

            "device-id" : device_id,

            "name" : name_of_device,

            ... other scraped information ...

            "routes" : [id_1, id_2, ..., id_N]}}

#+END_SRC


*** ROUTE INFO


#+BEGIN_SRC text

 /route-info/<route_id>

#+END_SRC


#+BEGIN_SRC javascript

 {"data": {"type"  : "route",

           "route-id" : route_id,

           "locations" : [{"time" : t_1, "lat" : lat_1, "lon" : lon_1},

                          {"time" : t_2, "lat" : lat_2, "lon" : lon_2},

                          ...]}}

#+END_SRC


** LIVE UPDATES

NOTE: listen for message ‘location’ so socket.on(‘location’,function(data){});

#+BEGIN_SRC javascript

 {"data" : {"type"  : "location-update",

            "route-id" : route_id,

            "location" : {"time" : t, "lat" : lat, "lon" : lon}}}

#+END_SRC


 

STANZA API.

http://138.68.135.245:3000/device-info/58892ed46209e776b5947a45/588e0eed8a821a68355447c8
http://138.68.135.245:3000/info/