Introduction to the API
The Smart WiFi Platform API provides access to essential data and functionality, enabling developers to integrate with the platform. By sending structured requests to our API endpoints, users can retrieve and manipulate data in real-time, enhancing any of your Guest engagement efforts with Smart WiFi features.
API Request Format
All requests to the API must be formatted in JSON and adhere to the following structure:
- HTTP Method: Requests will be made using standard HTTP methods such as:
GET: To retrieve data.PUT: To send or update data.DELETE: To delete data.
- Base URL: All API requests must begin with the base URL for your environment. To confirm your environment login to your Smart WiFi dashboard and visit the Client Customizations Page, main tab. Once you have confirmed your environment, select your Base URL below.US-Ahttps://api.smartwifiplatform.comUS-Bhttps://api-usb.smartwifiplatform.comUS-Chttps://api-usc.smartwifiplatform.comAP-Ahttps://api-apa.smartwifiplatform.com
Endpoint Requirements
- Authentication
All API requests require authentication via anapi_token, which must be passed as part of the request body in JSON format. Your SmartWiFi API Token can be collected by logging into your Smart WiFi dashboard and visiting the the Client Customizations Page, main tab. This token identifies and authenticates the client. Without a valid API token, access will be denied. - Request Headers
Ensure that all API requests include the appropriate headers, particularly Content-Type should be set to application/json to indicate the format of the request body. - Request Body
Any parameters required by the API must be passed within the request body as JSON. Parameters vary between endpoints but often include details like date ranges, state filters, or identifiers for specific resources. - API Response Format
The API responds with data in JSON format. Each response will include relevant information based on the requested endpoint and parameters. The typical structure consists of an array of objects or a single object, depending on the type of request.
Guest Endpoints
The following endpoints can be used to retrieve Guest data from your Smart WiFi account.
Description: This endpoint retrieves the Guest Plans that have been purchased through the splash page for the provided API token.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | ||
| state | No | active | active | expired | |
| started_since_timestamp | No | none | yyyy-mm-dd hh:mm:ss | 7 days ago |
| started_since_relative | No | 12h | 10m, 4h, 2d | 7 days |
Example Request:
{
"api_token": "<api token>",
"started_since_relative": "4d",
"state": "active"
}
Example Response:
[
{
"token": "Token associated with the Guest Profile for the MAC that purchased this plan",
"macaddress": "AA-BB-CC-DD-EE-FF",
"email": "Email associated with the plan (if available)",
"guest_plan_name": "Name of the purchased Guest Plan",
"guest_plan_start": "yyyy-mm-dd hh:mm:ss",
"guest_plan_expire": "yyyy-mm-dd hh:mm:ss",
"guest_plan_state": "Active or Expired",
"session_profile_name": "Session profile linked to the purchased Guest Plan",
"payment_gateway": "Voucher, PayPal, or the configured payment processor",
"gateway_transaction_id": "Voucher code or payment reference from the processor"
}
]Description: Returns a list of hotspots associated with the client API token.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired |
Example Request:
{
"api_token": "<api token>"
}
Example Response:
[
{
"id": 123,
"name": "Demo Hotspot 1"
},
{
"id": 124,
"name": "Demo Hotspot 2"
]Description: Delivers the Guest Profile details for the guest token associated to the client token.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| guest_token | Yes | none |
Example Request:
{
"api_token": "<api token>",
"guest_token": "<guest token>"
}
Example Response:
{
"custom1":null,
"custom2":null,
"custom3":null,
"custom4":null,
"custom5":null,
"custom6":null,
"custom7":null,
"custom8":null,
"custom9":null,
"custom10":null,
"client":{
"id":53,
"company":"TECH DEPT"
},
"profile":{
"firstname":null,
"lastname":null,
"email":"myemail@gmail.com",
"mobilephone":null,
"birthdate":null,
"macaddress":"4A-4A-EA-4A-4A-FA",
"gender":null,
"country":null,
"region":null,
"city":null,
"address":null,
"postal_code":null
},
"last_connection":{
"name":"TECHHOTSPOT",
"nasidentifier":"TECHHOTSPOT"
},
"unsubscribed":false
}Description: Returns a list of Guest profiles created associated to the Client API token. Using interval allows you to reduce the results to the past X number of minutes.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| unsubscribed | No | none | false | true | false |
| interval | No | none | 1440 | 10080 |
| hotspotid | No | none |
Example Request:
{
"api_token": "<api token>",
"unsubscribed": false,
"interval": 1440,
"hotspotid": 411
}
Example Response:
[
{
"id": 1981,
"total_connections": 1,
"macaddress": "0A-62-F7-2B-03-50",
"email": "demo1@mydomain.com",
"profile_url": null,
"display_name": null,
"first_name": null,
"last_name": null,
"gender": null,
"country": null,
"region": null,
"city": null,
"address": null,
"age": null,
"mobile_phone": null,
"birthdate": null,
"postal_code": null,
"custom1": null,
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null,
"unsubscribed": false,
"seatgeek_crm_id": null
},
{
"id": 1920,
"total_connections": 1,
"macaddress": "FE-D0-80-20-3D-16",
"email": "demo2@example.com",
"profile_url": null,
"display_name": null,
"first_name": null,
"last_name": null,
"gender": null,
"country": null,
"region": null,
"city": null,
"address": null,
"age": null,
"mobile_phone": null,
"birthdate": null,
"postal_code": null,
"custom1": null,
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null,
"unsubscribed": false,
"seatgeek_crm_id": null
}
]Description: Pings the server and returns a success message.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired |
Example Request:
{
"api_token": "<api token>"
}
Example Response:
{
"message": "success"
}Description: Returns a list of Guest Connections associated with the api token for the date range provided. The fields returned will match the Guest Connections Report in the Dashboard.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| from | No | none | yyyy-mm-dd | |
| to | No | none | yyyy-mm-dd | |
| guestid | No | none | ||
| hotspotids | No | none | 12 hours of data |
Example Request:
{
"api_token" : "<api token>",
"start_date": "2024-08-05 T 00:00:00",
"end_date": "2024-08-05 T 23:59:59"
}
Example Response:
[
{
"date": "2024-08-05T12:30:34.985301",
"email": "demoemail1@gmail.com",
"phone": null,
"device": "Android",
"mobile": null,
"identity": "demoemail1@gmail.com",
"lastname": null,
"uploaded": 3255631,
"firstname": null,
"useragent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/25.0 Chrome/121.0.0.0 Mobile Safari/537.36",
"downloaded": 66239763,
"guesttoken": "1xexbx0x-cxfx-4x2x-8x7x-cx7x7x2x7x9x",
"macaddress": "5X-3X-BX-EX-0X-4X",
"hotspotname": "Demo Hotspot",
"online_time": "01:00:30",
"profileuser": null,
"reason_for_termination": "Session Timeout"
},
{
"date": "2024-08-05T12:31:17.589298",
"email": "demoemail2@gmail.com",
"phone": null,
"device": "Android",
"mobile": null,
"identity": "demoemail2@gmail.com",
"lastname": null,
"uploaded": 647401,
"firstname": null,
"useragent": "Mozilla/5.0 (Linux; Android 13; SM-S135DL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36",
"downloaded": 10423458,
"guesttoken": "xbxcxdxe-x8x9-x2x2-x2xc-x0x6x2x3x4x0",
"macaddress": "EX-0X-EX-AX-7X-3X",
"hotspotname": "Demo Hotspot",
"online_time": "00:50:56",
"profileuser": null,
"reason_for_termination": "Idle Timeout"
}
]Contact Endpoints
The following endpoints can be used to manipulate Contacts inside your Smart WiFi Contact Manager.
Description: Searches the existing Contacts associated to the client API token and returns a list of matching results. Searches on Email, Phone, or Twitter username only.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| search | Yes | none | string | |
| limit | No | min:0 | ||
| offset | No | Min:2 Max:1000 |
Example Request:
{
"api_token" : "<api token>",
"search" : "joe"
}
Example Response:
[
{
"id": 145361,
"email": "joesmith@example.com",
"firstname": "Joe",
"lastname": "Smith",
"twitter_username": null,
"mobilephone": null,
"birthdate": "1969-06-30",
"address": null,
"address2": null,
"city": null,
"region": "Florida",
"country": "Usa",
"postal_code": null,
"token": "dx8x9x9x-x2x9-x6xf-x3x3-1xdxcx6xbx1x",
"unsubscribe": false,
"create_date": "2024-06-15 11:01:02.241501+00",
"custom1": "One",
"custom2": "Two",
"custom3": "Three",
"custom4": "Four",
"custom5": "Five",
"custom6": "Six",
"custom7": "Seven",
"custom8": "Eight",
"custom9": "Nine",
"custom10": "Ten",
"delete_date": null,
"last_connection": "2024-06-14 16:56:25.178189+00",
"last_presence": "2024-03-03 23:15:36+00",
"gender": "male",
"tags": [
{
"name": "TestingTags"
},
{
"name": "Android"
}
]
}
]Description: Returns the data for the specified Contact associated to the client API token. Replace {contact_id} in the endpoint location with the integer of your desired contact profile. In the example below 145361 was used for the {contact_id}.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired |
Example Request:
{
"api_token" : "<api token>"
}
Example Response:
[
{
"id": 145361,
"email": "joesmith@example.com",
"firstname": "Joe",
"lastname": "Smith",
"twitter_username": null,
"mobilephone": null,
"birthdate": "1969-06-30",
"address": null,
"address2": null,
"city": null,
"region": "Florida",
"country": "Usa",
"postal_code": null,
"token": "dx8x9x9x-x2x9-x6xf-x3x3-1xdxcx6xbx1x",
"unsubscribe": false,
"create_date": "2024-06-15 11:01:02.241501+00",
"custom1": "One",
"custom2": "Two",
"custom3": "Three",
"custom4": "Four",
"custom5": "Five",
"custom6": "Six",
"custom7": "Seven",
"custom8": "Eight",
"custom9": "Nine",
"custom10": "Ten",
"delete_date": null,
"last_connection": "2024-06-14 16:56:25.178189+00",
"last_presence": "2024-03-03 23:15:36+00",
"gender": "male",
"tags": [
{
"name": "TestingTags"
},
{
"name": "Android"
}
]
}
]Description: Deletes the specified Contact associated to the client API token. Replace {contact_id} in the endpoint location with the integer of your desired contact profile.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired |
Example Request:
{
"api_token" : "<api token>"
}
Example Response:
Description: Creates a Contact under the Client of the API token using the supplied fields. The platform will first search existing Contacts based on Email, Mobilephone, and Twitter Username and if a match is found the new data will be merged into the null fields of the existing Contact. Tags included in the body of the request will also be merged to any existing tags when a match occurs.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| No | ||||
| firstname | No | |||
| lastname | No | |||
| twitter_username | No | |||
| mobilephone | No | |||
| birthdate | No | yyyy-mm-dd | ||
| address | No | |||
| address2 | No | |||
| city | No | |||
| region | No | |||
| country | No | |||
| postal_code | No | |||
| custom1 | No | |||
| custom2 | No | |||
| custom3 | No | |||
| custom4 | No | |||
| custom5 | No | |||
| custom6 | No | |||
| custom7 | No | |||
| custom8 | No | |||
| custom9 | No | |||
| custom10 | No | |||
| gender | No | male | male | female | |
| unsubscribe | No | false | true | boolean |
| tags | No | “tags”:[{“name”:”Tag1″},{“name”:”Tag2″}] | Array of tags |
Example Request:
{
"api_token": "<api token>",
"email": "demoemail@example.com",
"firstname": "Wood",
"lastname": "Stock",
"birthdate": "1969-09-15",
"custom1": "Groovy",
"tags":["Tag1","Tag2","Tag3"]
}
Example Response:
{
"id": 845378,
"email": "demoemail@example.com",
"firstname": "Wood",
"lastname": "Stock",
"twitter_username": null,
"mobilephone": null,
"birthdate": "1969-09-15",
"address": null,
"address2": null,
"city": null,
"region": null,
"country": null,
"postal_code": null,
"token": "x5xbx7xb-xfxx-xdx5-8x1x-xdx0x2xaxfx2",
"unsubscribe": false,
"create_date": "2024-10-21 20:16:23.303552+00",
"custom1": "Groovy",
"custom2": null,
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null,
"delete_date": null,
"last_connection": null,
"last_presence": null,
"gender": null,
"tags": [
{
"name": "Tag1"
},
{
"name": "Tag2"
},
{
"name": "Tag3"
}
]
}
Description: Updates the specified Contact associated to the client API token with the supplied fields. Any existing Contact data (including tags) will be overwritten if new data is supplied in the body of the message. Replace {contact_id} in the endpoint location with the integer of your desired contact profile.In the example below 845378 was used as the {contact_id}.
Available Parameters:
| Parameter | Required | Default | Format/Example | Limits |
| api_token | Yes | none | active | expired | |
| No | ||||
| firstname | No | |||
| lastname | No | |||
| twitter_username | No | |||
| mobilephone | No | |||
| birthdate | No | yyyy-mm-dd | ||
| address | No | |||
| address2 | No | |||
| city | No | |||
| region | No | |||
| country | No | |||
| postal_code | No | |||
| custom1 | No | |||
| custom2 | No | |||
| custom3 | No | |||
| custom4 | No | |||
| custom5 | No | |||
| custom6 | No | |||
| custom7 | No | |||
| custom8 | No | |||
| custom9 | No | |||
| custom10 | No | |||
| gender | No | male | male | female | |
| unsubscribe | No | false | true | boolean |
| tags | No | “tags”:[{“name”:”Tag1″},{“name”:”Tag2″}] | Array of tags |
Example Request:
{
"api_token": "<api token>",
"postal_code": "12345",
"firstname": "Frank",
"custom2": "Tuesday",
"tags":["Tag4","Tag5"]
]
}
Example Response:
{
"id": 845378,
"email": "demoemail@example.com",
"firstname": "Frank",
"lastname": "Stock",
"twitter_username": null,
"mobilephone": null,
"birthdate": "1969-09-15",
"address": null,
"address2": null,
"city": null,
"region": null,
"country": null,
"postal_code": "12345",
"token": "2xbx2x5x-x7xb-xdx5-x8xf-xdx0x2xaxfx2",
"unsubscribe": false,
"create_date": "2024-10-21 20:16:23.303552+00",
"custom1": "Groovy",
"custom2": "Tuesday",
"custom3": null,
"custom4": null,
"custom5": null,
"custom6": null,
"custom7": null,
"custom8": null,
"custom9": null,
"custom10": null,
"delete_date": null,
"last_connection": null,
"last_presence": null,
"gender": null,
"tags": [
{
"name": "Tag1"
},
{
"name": "Tag2"
},
{
"name": "Tag3"
},
{
"name": "Tag4"
},
{
"name": "Tag5"
}
]
}