How to use API

Yes. We have a restful API that data can be pulled and exported directly from the online portal.

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:http://sys.gazellawifi.com/api/

Authentication

You authenticate to the API by providing your API key in the request. You can manage your API key in the ‘Settings’ tab.http://sys.gazellawifi.com/api/key= {yourkey}&{Endpoint} All calls require authentication to the API.

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:2016-06-27T04:10:21.000Z (Complete date plus hours and minutes and seconds)

Response Codes

The API returns standard HTTP response codes.

Tables can't be imported directly. Please insert an image of your table which can be found here.

CodeDescription200Everything worked as expected400Bad Request - Often missing a required parameter401Unauthorized - No valid API key provided 

Get Visitors

The API returns standard HTTP response codes.

Tables can't be imported directly. Please insert an image of your table which can be found here.

HTTP methodEndpointFunctionGET&page_id= {your-page-id}&page=1&results=5UNIQUE VALUESGet a list of (5) Visitors from a specific location by page idGET&page_id= {your-page-id}&page=1&results=50UNIQUE VALUESGet a list of (50) Visitors from a specific location by page idHow to get a Location's "page id" is by going to the location's settings tab. Once you are there, in purple beside the title you will see the Page ID.   $url = 'http://sys.gazellawifi.com/api/key={yourkey}&page_id={your-page-id}&results=5'; $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.'; } 'http://sys.gazellawifi.com/api/key= {yourkey}&page_id= {your-page-id}&results=5'55trueifemptytrueelseecho'Sorry, but there was a problem connecting to the API.' Example Return: [ { "id": 1765, "date": "2016-07-15T15:42:50.000Z", "check_type": "facebook", "page_id": 94, "user_id": 11, "visitor_mac": "94-E9-6A-A1-31-DF", "name": "Jim Burns", "email": "jim@gmail.com", "phone": "", "gender": "male", "approx_age": "min 21", "mobile": 1, "browser": "Apple Safari", "os": "Safari" } ] "id"1765"date""2016-07-15T15:42:50.000Z""check_type""facebook""page_id"94"user_id"11"visitor_mac""94-E9-6A-A1-31-DF""name""Jim Burns""email""jim@gmail.com""phone""""gender""male""approx_age""min 21""mobile"1"browser""Apple Safari""os""Safari"