API Documents


Developers Unite!!!
Our Restful Documentation


General

The API is built on HTTP. Our API is RESTful and it:

  • Uses predictable, resource-oriented URLs.
  • Uses built-in HTTP capabilities for passing parameters and authentication.
  • Responds with standard HTTP response codes to indicate errors.
  • Returns JSON.

We have Libraries for various languages. You may use our libraries, or your favorite HTTP/REST library available for your programming language, to make HTTP calls to the API.

To give you an idea of how to use the API, we have annotated our documentation with code samples written in several popular programming languages. Use the language selector at the top to switch between them.


Base URL

All API URLs referenced in this documentation start with the following base part:

https://sys.gazellawifi.com/api/v2/

Or Your Reseller Domain:
http://sys.yourdomain.com/api/v2/

Currently API supports only GET requests.


Authentication

You authenticate to the API by providing your API key in the request. You can manage your API key in the ‘Settings’ tab.

https://sys.gazellawifi.com/api/v2/{endpoint}?key={yourkey}

All calls require authentication to the API.


Response Codes

The API returns standard HTTP response codes.

Code Description
200 Everything worked as expected
400 Bad Request - Often missing a required parameter
401 Unauthorized - No valid API key provided
404 Not found - Requested resource not found

Date Format

The API returns JSON for all API calls. JSON does not have a built-in date type, dates are passed as strings encoded according to ISO 8601. This format that is output:

2017-05-12T04:10:21.000Z

(Complete date plus hours and minutes and seconds)


Additional parameters

You can add additional GET params to your query. Each value must be appended to your link with & symbol.

Available params:

  • results - count of items in response array. Default value: 25.

    You can pass results param to all endpoints that return an array of values.

    For example, if you want to fetch only 5 locations, your request will look like:

    https://sys.gazellawifi.com/api/v2/me/locations?key={yourkey}&results=5

  • page - used to skip first elements in response array. Default value: 1.

    You can pass page param to all endpoints that return an array of values to make pagination.

    For example, to skip first 10 locations and fetch next 10 you may use this URL:

    https://sys.gazellawifi.com/api/v2/me/locations?key={yourkey}&page=2&results=10

Endpoints


Locations

Method Endpoint Description Response type
GET me/locations get locations array
GET me/location/{id} get location info object
GET me/location/{id}/routers get location routers array
GET me/location/{id}/sensors get location sensors array
GET me/location/{id}/visitors get location visitors array
PUT me/location/{id}/css update location custom CSS object
PUT me/location/{id}/html update location splash page HTML content object

Routers

Method Endpoint Description Response type
GET me/routers get routers array
GET me/router/{id} get router info object

Sensors

Method Endpoint Description Response type
GET me/sensors get sensors array
GET me/sensor/{id} get sensor info object


Examples


Get locations

Get 50 locations:

https://sys.gazellawifi.com/api/v2/me/locations?key={yourkey}&page=1&results=50

$url = 'https://sys.gazellawifi.com/api/v2/me/locations?key={yourkey}&page=1&results=50';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/locations?key={yourkey}&page=1&results=50';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "location_id": 1,
        "location_name": "Example Location",
        "location_address_lat": "91.212606",
        "location_address_lon": "-46.18974300000002",
        "location_address_number": "123",
        "location_address_street": "Example Street",
        "location_address_city": "Omaha",
        "location_address_state": "NE",
        "location_address_zipcode": "12345",
        "location_address_country": "United States",
        "location_address_timezone": null,
        "location_redirection_url": "https://google.com",
        "router_sticker_ids": [11, 22],
        "sensor_sticker_ids": [33, 44]
    }
]


Get location info

Get location info:

https://sys.gazellawifi.com/api/v2/me/location/{id}?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}?key={yourkey}';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

{
    "location_id": 1,
    "location_name": "Example Location",
    "location_address_lat": "91.212606",
    "location_address_lon": "-46.18974300000002",
    "location_address_number": "123",
    "location_address_street": "Example Street",
    "location_address_city": "Omaha",
    "location_address_state": "NE",
    "location_address_zipcode": "12345",
    "location_address_country": "United States",
    "location_address_timezone": null,
    "location_redirection_url": "https://google.com",
    "router_sticker_ids": [11, 22],
    "sensor_sticker_ids": [33, 44]
}


Get location routers

Get 50 routers:

https://sys.gazellawifi.com/api/v2/me/location/{id}/routers?key={yourkey}&page=1&results=50

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}/routers?key={yourkey}&page=1&results=50';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}/routers?key={yourkey}&page=1&results=50';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "mac_id": 3,
        "mac_name": "11-11-11-11-11-11",
        "location_id": 123,
        "created_on": "2017-05-26T08:45:40.000Z",
        "session_timeout": "300",
        "landing_page": "http://connect.gazellawifi.com/page/index.php?locationId=123",
        "max_data": "4194304000",
        "device_time": "2017-12-24T13:47:49.000000Z",
        "device_ssid": "Router SSID",
        "routerName": "PRIVATE",
        "device_owner_id": 1,
        "last_ip": "188.163.33.163"
    }
]


Get location sensors

Get all sensors:

https://sys.gazellawifi.com/api/v2/me/location/{id}/sensors?key={yourkey}&results=99999

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}/sensors?key={yourkey}&results=99999';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}/sensors?key={yourkey}&results=99999';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "id": 6,
        "mac": "22-22-22-22-22-22",
        "location_id": 456,
        "owner_id": 1,
        "last_time": "2017-12-05T08:17:54.000000Z",
        "last_ip": "188.163.33.163",
        "created_on": "2017-10-17T12:50:24.000Z",
        "device_ssid": "Access Point SSID"
    }
]


Get location visitors

Get 25 visitors (because no results param specified):

https://sys.gazellawifi.com/api/v2/me/location/{id}/visitors?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}/visitors?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}/visitors?key={yourkey}';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "id": 12345,
        "date": "2017-12-05T12:22:29.000Z",
        "check_type": "phone",
        "page_id": 123,
        "user_id": 1,
        "router_mac": "11-11-11-11-11-11",
        "visitor_mac": "33-33-33-33-33-33",
        "name": "",
        "email": "",
        "phone": "+12345678987",
        "gender": "",
        "birthday": "1986-11-26T00:00:00.000Z",
        "approx_age": "min 21",
        "agreed_to_terms": 0,
        "mobile": 0,
        "browser": "Google Chrome",
        "os": "Windows",
        "ip": "",
        "ufbid": "",
        "location": "",
        "locale": "",
        "link": "",
        "picture": "",
        "custom1": "",
        "custom2": "",
        "custom3": "",
        "banned": null
    }
]

“birthday”: “1000-07-29T00:00:00.000Z”

Update location CSS

Update location splash page custom CSS

https://sys.gazellawifi.com/api/v2/me/location/{id}/css?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}/css?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, '.some-element{color:#fafafa;}');
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}/css?key={yourkey}';
    $.ajax({
        url: url,
        method: 'PUT',
        data: '.some-element{color:#fafafa;}'
    })
        .done(function(data) {
            console.log(data);
        });
});

Example response:

{
    "success": true,
    "message": "Success!"
}


Update location HTML

Update location splash page HTML content

https://sys.gazellawifi.com/api/v2/me/location/{id}/html?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/me/location/{id}/html?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, '<h1>Welcome!</h1>');
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/location/{id}/html?key={yourkey}';
    $.ajax({
        url: url,
        method: 'PUT',
        data: '<h1>Welcome!</h1>'
    })
        .done(function(data) {
            console.log(data);
        });
});

Example response:

{
    "success": true,
    "message": "Success!"
}

Reseller Endpoints


Managed users

Method Endpoint Description Response type
GET me/users get managed users array
GET me/user/{id} get managed user info object

Locations

Method Endpoint Description Response type
GET user/{id}/locations get managed user’s locations array
GET user/{id}/location/{id} get managed user’s location info object
GET user/{id}/location/{id}/routers get managed user’s location routers array
GET user/{id}/location/{id}/sensors get managed user’s location sensors array
GET user/{id}/location/{id}/visitors get managed user’s location visitors array

Routers

Method Endpoint Description Response type
GET user/{id}/routers get managed user’s routers array
GET user/{id}/router/{id} get managed user’s router info object

Sensors

Method Endpoint Description Response type
GET user/{id}/sensors get managed user’s sensors array
GET user/{id}/sensor/{id} get managed user’s sensor info object



Reseller Examples


Get managed users

Get 50 users:

https://sys.gazellawifi.com/api/v2/me/users?key={yourkey}&page=1&results=50

$url = 'https://sys.gazellawifi.com/api/v2/me/users?key={yourkey}&page=1&results=50';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/users?key={yourkey}&page=1&results=50';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "user_id": 62,
        "owner_user_id": 26,
        "user_email": "user@mail.com",
        "user_company_name": "",
        "user_registered": "2017-10-19T13:05:24+00:00",
        "user_login_url": "/api-login/?token=eyJydWlkIjo0OCwidWlkIjo4MSwidGltZXN0YW1wIjoiMjAxNy0xMi0wNSAxNTowODo1MiJ9fDc5ZjQ5M2RjMGQ5ZjhjYWE1MzNlOGJlNGZjODViODY1MzAyY2I4ODY="
    }
]


Get managed user info

Get managed user info:

https://sys.gazellawifi.com/api/v2/me/user/{userid}?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/me/user/{userid}?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/me/user/{userid}?key={yourkey}';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

{
    "user_id": 62,
    "owner_user_id": 26,
    "user_email": "user@mail.com",
    "user_company_name": "",
    "user_registered": "2017-10-19T13:05:24+00:00",
    "user_login_url": "/api-login/?token=eyJydWlkIjo0OCwidWlkIjo4MSwidGltZXN0YW1wIjoiMjAxNy0xMi0wNSAxNTowODo1MiJ9fDc5ZjQ5M2RjMGQ5ZjhjYWE1MzNlOGJlNGZjODViODY1MzAyY2I4ODY="
}


Get locations

Get 50 locations:

https://sys.gazellawifi.com/api/v2/user/{userid}/locations?key={yourkey}&page=1&results=50

$url = 'https://sys.gazellawifi.com/api/v2/user/{userid}/locations?key={yourkey}&page=1&results=50';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/user/{userid}/locations?key={yourkey}&page=1&results=50';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "location_id": 1,
        "location_name": "Example Location",
        "location_address_lat": "91.212606",
        "location_address_lon": "-46.18974300000002",
        "location_address_number": "123",
        "location_address_street": "Example Street",
        "location_address_city": "Omaha",
        "location_address_state": "NE",
        "location_address_zipcode": "12345",
        "location_address_country": "United States",
        "location_address_timezone": null,
        "location_redirection_url": "https://google.com",
        "router_sticker_ids": [11, 22],
        "sensor_sticker_ids": [33, 44]
    }
]


Get location info

Get location info:

https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}?key={yourkey}';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

{
    "location_id": 1,
    "location_name": "Example Location",
    "location_address_lat": "91.212606",
    "location_address_lon": "-46.18974300000002",
    "location_address_number": "123",
    "location_address_street": "Example Street",
    "location_address_city": "Omaha",
    "location_address_state": "NE",
    "location_address_zipcode": "12345",
    "location_address_country": "United States",
    "location_address_timezone": null,
    "location_redirection_url": "https://google.com",
    "router_sticker_ids": [11, 22],
    "sensor_sticker_ids": [33, 44]
}


Get location routers

Get 50 routers:

https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/routers?key={yourkey}&page=1&results=50

$url = 'https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/routers?key={yourkey}&page=1&results=50';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/routers?key={yourkey}&page=1&results=50';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "mac_id": 3,
        "mac_name": "11-11-11-11-11-11",
        "location_id": 123,
        "created_on": "2017-05-26T08:45:40.000Z",
        "session_timeout": "300",
        "landing_page": "http://connect.gazellawifi.com/page/index.php?locationId=123",
        "max_data": "4194304000",
        "device_time": "2017-12-24T13:47:49.000000Z",
        "device_ssid": "Router SSID",
        "routerName": "PRIVATE",
        "device_owner_id": 1,
        "last_ip": "188.163.33.163"
    }
]


Get location sensors

Get all sensors:

https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/sensors?key={yourkey}&results=99999

$url = 'https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/sensors?key={yourkey}&results=99999';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/sensors?key={yourkey}&results=99999';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "id": 6,
        "mac": "22-22-22-22-22-22",
        "location_id": 456,
        "owner_id": 1,
        "last_time": "2017-12-05T08:17:54.000000Z",
        "last_ip": "188.163.33.163",
        "created_on": "2017-10-17T12:50:24.000Z",
        "device_ssid": "Access Point SSID"
    }
]


Get location visitors

Get 25 visitors (because no results param specified):

https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/visitors?key={yourkey}

$url = 'https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/visitors?key={yourkey}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$ch_data = curl_exec($ch);
curl_close($ch);

if (!empty($ch_data)) {
    $json_data = json_decode($ch_data, true);
    print_r($json_data);
} else {
    echo 'Sorry, but there was a problem connecting to the API.';
}

$(document).ready(function() {
    var url='https://sys.gazellawifi.com/api/v2/user/{userid}/location/{id}/visitors?key={yourkey}';
    $.getJSON(url, function(data) {
        console.log(data);
    });
});

Example response:

[
    {
        "id": 12345,
        "date": "2017-12-05T12:22:29.000Z",
        "check_type": "phone",
        "page_id": 123,
        "user_id": 1,
        "router_mac": "11-11-11-11-11-11",
        "visitor_mac": "33-33-33-33-33-33",
        "name": "",
        "email": "",
        "phone": "+12345678987",
        "gender": "",
        "birthday": "1986-11-26T00:00:00.000Z",
        "approx_age": "min 21",
        "agreed_to_terms": 0,
        "mobile": 0,
        "browser": "Google Chrome",
        "os": "Windows",
        "ip": "",
        "ufbid": "",
        "location": "",
        "locale": "",
        "link": "",
        "picture": "",
        "custom1": "",
        "custom2": "",
        "custom3": "",
        "banned": null
    }
]

“birthday”: “1000-07-29T00:00:00.000Z”