Navizon  I.T.S. Documentation

API - Reference (V.1)

The list of resources and the supported method is summarized in the following table:

URI Available HTTP Methods
/api/v1/sites/ GET
/api/v1/sites/{siteId}/ GET
/api/v1/sites/{siteId}/nodes/ GET
/api/v1/sites/{siteId}/nodes/{mac}/ GET, PUT, DELETE
/api/v1/sites/{siteId}/stations/ GET
/api/v1/sites/{siteId}/stations/{mac}/ GET, PUT, DELETE
/api/v1/sites/{siteId}/stations/callbacks/ GET

Resources

Example

Query the list of sites registered with the account username using curl

curl -u username:password http://its.navizon.com/api/v1/sites/

The result is an array [{...}, {...}, ...] of JSON objects:

[{
    "siteId": "1001",
    "name": "Site A",
    "desc": "Test site description",
    "address": "New York, NY",
    "cloudtrax_network": "site_a_network",
    "cloudtrax_password": "xxxxxx",
},
{
    "siteId": "1002",
    "name": "Site B",
    "desc": "Test site description",
    "address": "Atlanta, GA"
    "cloudtrax_network": "site_b_network"
    "cloudtrax_password": "xxxxxx",
}]
Example

Retrieve information about the site with siteId="1001":

curl -u username:password http://its.navizon.com/api/v1/sites/1001/

The result is a JSON object:

{
    "siteId": "1001",
    "name": "Site A",
    "desc": "Test site description",
    "address": "New York, NY",
    "cloudtrax_network": "site_a_network",
    "cloudtrax_password": "xxxxxx",
}
Example

Retrieve the list of nodes registered with siteId="1001":

curl -u username:password http://its.navizon.com/api/v1/sites/1001/nodes/

The result is an array [{...}, {...}, ...] of JSON objects:

[{
    "mac": "7072CF2148F0",
    "name": "node2",
    "desc": "",
    "siteId": "1001",
    "loc": {
        "source": "manual",
        "lng": -117.114494,
        "lat": 32.911827
    },
    "lrrt": 1,
    "lrne": 8
},
{
    "mac": "7072CF173036",
    "name": "node1",
    "desc": "",
    "siteId": "1001",
    "loc": {
        "source": "manual",
        "lng": -117.114607,
        "lat": 32.911951
    },
    "lrrt": 1,
    "lrne": 9
}]
Note:
Example

Retrieve information about the node with MAC address 7072CF2148F0 from siteId="1001":

curl -u username:password http://its.navizon.com/api/v1/sites/1001/nodes/7072CF2148F0/

The result is a JSON object:

{
    "mac": "7072CF2148F0",
    "name": "node2",
    "desc": "",
    "siteId": "1001",
    "loc": {
        "source": "manual",
        "lng": -117.114494,
        "lat": 32.911827
    },
    "lrrt": 1,
    "lrne": 8
}
Note:
Example

Register a node with MAC address 000011112222 in siteId="1001".

curl -u username:password -X PUT -d "name=Office14b&desc=corner office&lat=32.911982&lng=-117.114369&alt=0" http://its.navizon.com/api/v1/sites/1001/nodes/000011112222/

The result is a JSON object that describes the node just registered:

{
    "mac":"000011112222",
    "name":"Office14b",
    "desc":"corner office",
    "siteId":"1001",
    "loc":{
        "source":"manual",
        "lng":"32.911982",
        "lat":"-117.114369",
        "alt":"0",
    }
}
Example

Remove the node with MAC address 000011112222 from siteId="1001"

curl -u username:password -X DELETE http://its.navizon.com/api/v1/sites/1/nodes/000011112222/

Querying for a node just removed will return an HTTP 404 - Not found status code

curl -u username:password http://its.navizon.com/api/v1/sites/1/nodes/000011112222/

Resource not found
    
Example 1:

Retrieve the list of stations active within siteId=1001. If the query parameters are not specified, the default values will be used. By default the result will contain only the known stations with lrrt < 10.

curl -u username:password http://its.navizon.com/api/v1/sites/1001/stations/

The result is an array [{...}, {...}, ...] of JSON objects:

[
    {

        "mac": "485B394AC5E9"
        "name": "laptop",
        "desc": "Bill's laptop"
        "lrrt": 1,
    },
    {
        "mac": "00237698BDEC"
        "name: "smart phone"
        "desc": "Tom's phone",
        "lrrt": 12,
    },
    ...
]
Note:
Example 2:

Query all the stations active in the last 15 seconds, and request location information in the response

curl -u username:password "http://its.navizon.com:8080/api/v1/sites/1001/stations/?loc=yes&type=all&lrrt=15"

The result is an array [{...}, {...}, ...] of JSON objects:

[
    {
        "mac": "485B394AC5E9"
        "name": "laptop",
        "desc": "Bill's laptop",
        "lrrt": 1,
        "loc": {
            "lng": -117.114326,
            "lat": 32.91186
        },
    },
    {
        "mac": "00237698BDEC"
        "name": "smart phone",
        "desc": "Tom's phone",
        "lrrt": 9,
        "loc": {
            "lng": -117.114268,
            "lat": 32.911822
        },
    },
    {
        "mac":"0072CF173037",
        "lrrt":0,
        "loc":{
            "lng":-117.114604,
            "lat":32.91195
        }
    },
    ...
]
Example

Retrieve information about station with MAC address 7072CF2148F0 from siteId="1001":

curl -u username:password 50.18.115.171:8080/api/v1/sites/1001/stations/7072CF2148F0/

The result is a JSON Object. If the location of the station is available, it will be returned with the response. Additionally, if the station has been previously registered in the list of known stations, its name and description will also be returned in the representation:

{
    "mac": "7072CF2148F0",
    "name": "node2",
    "desc": "",
    "siteId": "1001",
    "loc": {
        "source": "manual",
        "alt": "NaN",
        "lng": -117.114494,
        "lat": 32.911827
    },
    "lrrt": 1,
    "lrne": 8
}
Note:
Example

Register a station with MAC address 0072CF173037 in siteId="1001"

curl -u username:password -X PUT -d "name=mydevice&desc=test device" http://its.navizon.com/api/v1/sites/1001/stations/0072CF173037/

The result is a JSON that describes the station just registered:

{
    "mac":"0072CF173037",
    "name":"mydevice",
    "desc":"test device",
}
Example

Remove the station with MAC address 0072CF173037 from siteId="1001"

curl -u username:password -X DELETE http://its.navizon.com/api/v1/sites/1001/stations/0072CF173037/

0072CF173037 removed from site 1001
Example

Retrieve the callback URL registered with siteId="1001":

curl -u username:password http://its.navizon.com/api/v1/sites/1001/stations/callbacks/

The result is a JSON Object:

{
    "callback": "http://my.site.com/callback.php"
}
Example

Register "http://my.site.com/notify.aspx as callback URL for siteId="1001".

curl -u username:password -X PUT -d "callback=http://my.site.com/notify.aspx" http://its.navizon.com/api/v1/sites/1001/callbacks/

Example

Disable notifications for siteId=1001

curl -u username:password -X DELETE http://its.navizon.com/api/v1/sites/1001/stations/callbacks/