Getting devices status¶
Getting radius secret¶
Radius secret is needed for device configuration in order for the Social WiFi service to work.
You can retrieve radius-secret it like so:
GET /devices/venue-radius-secrets/?filter[venue_id]=VENUE_ID
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/devices/venue-radius-secrets/?filter\[venue_id\]=VENUE_ID" \
| jq
Response
{
"data": [
{
"type": "venue-radius-secrets",
"id": "6a8886dd-f1c9-426a-b09d-3ef43c11efb3",
"attributes": {
"secret": "69e3a612e6d0",
"venue-id": "22222222-2222-2222-2222-222222222222"
}
}
],
"meta": {
"count": 1
},
"jsonapi": {
"version": "1.0"
}
}
Listing devices¶
To list configured network devices (access-point) use the /access-points/ endpoint:
GET /devices/access-points/?filter[venue]=VENUE_ID&page[number]=1&page[size]=20
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/devices/access-points/?filter\[venue\]=VENUE_ID&page\[number\]=1&page\[size\]=20" \
| jq
Pagination filters¶
The list is paginated due to large amount of data it has to pull. If you want the full list you will have to go through multiple requests:
| Key | Example |
|---|---|
page[number] |
page[number]=1 |
page[size] |
page[size]=20 |
Do not use large page sizes or the endpoint will not return data in time.
The JSON response will have pagination data under links key so you can follow URLs until there won't be any
next URL given.
Response
{
"data": [
{
"type": "access-points",
"id": "44444444-4444-4444-4444-444444444444",
"attributes": {
"mac": "00:01:02:03:04:ff",
"verified-date": "2017-02-22T17:37:59+00:00",
"name": "",
"vendor": ""
},
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "11111111-1111-1111-1111-111111111111"
}
},
"venue": {
"data": {
"type": "venues",
"id": "22222222-2222-2222-2222-222222222222"
}
}
},
},
{
"type": "access-points",
"id": "55555555-5555-5555-5555-555555555555",
"attributes": {
"mac": "00:01:02:03:04:ee",
"verified-date": "2017-03-10T17:37:59+00:00",
"name": "",
"vendor": ""
},
"relationships": {
"project": {
"data": {
"type": "projects",
"id": "11111111-1111-1111-1111-111111111111"
}
},
"venue": {
"data": {
"type": "venues",
"id": "22222222-2222-2222-2222-222222222222"
}
}
}
}
],
"links": {
"self": "https://api.socialwifi.com/devices/access-points/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&page[number]=1",
"first": "https://api.socialwifi.com/devices/access-points/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&page[number]=1",
"previous": null,
"next": null,
"last": "https://api.socialwifi.com/devices/access-points/?filter[venue]=22222222-2222-2222-2222-222222222222&page[size]=20&page[number]=1"
},
"meta": {
"count": 2
},
"jsonapi": {
"version": "1.0"
}
}
Getting device status¶
You can check if given device is working properly (does Social WiFi service gets all of the expected data/traffic) by using the access-point-status endpoint:
GET /analytics/ap-status/VENUE_ID/?filter[ap_mac]=MAC,MAC...
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
https://api.socialwifi.com/analytics/ap-status/VENUE_ID/?filter[ap_mac]=00:01:02:03:04:ff,... \
| jq
Available filters¶
| Key | Example | Description |
|---|---|---|
ap_mac |
?filter[ap_mac]=00:01:02:03:04:ff,00:01:02:03:04:fa |
Comma delimited list of device MAC addresses |
Response
{
"data": [
{
"type": "access-point-status",
"id": "00:01:02:03:04:ff",
"attributes": {
"mac": "00:01:02:03:04:ff",
"steps": {
"device_returned_from_radius": {
"state": "error",
"last_date": null
},
"device_detected": {
"state": "warning",
"last_date": "2021-04-08T11:02:31.815974+00:00"
},
"device_redirected_to_radius": {
"state": "error",
"last_date": null
},
"device_authenticated": {
"state": "error",
"last_date": null
}
},
}
},
{
"type": "access-point-status",
"id": "00:01:01:01:04:ff",
"attributes": {
"mac": "00:01:01:01:04:ff",
"steps": {
"device_returned_from_radius": {
"state": "error",
"last_date": null
},
"device_detected": {
"state": "error",
"last_date": null
},
"device_redirected_to_radius": {
"state": "error",
"last_date": null
},
"device_authenticated": {
"state": "error",
"last_date": null
}
}
}
},
],
"meta": {
"count": 2
},
"jsonapi": {
"version": "1.0"
}
}
access-point-status returns four steps representing parts of user login process.
When Social WiFi doesn't see a constant flow of logs/data for each step it will mark given step as error which may indicate a
problem with the device, network connection or just lack of user logins.
Getting network settings¶
Venue can have network limits set in the client panel as an optional configuration. You can retrieve those network settings like so:
GET /devices/network-settings/?filter[venue]=VENUE_ID
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/devices/network-settings/?filter\[venue\]=VENUE_ID" \
| jq
Response
{
"data": [
{
"type": "network-settings",
"id": "0c914efd-fc3c-419f-92d0-15d7be550a41",
"attributes": {
"upload-limit": null,
"session-time": 2233,
"download-rate-limit": null,
"download-limit": 3,
"idle-time": null,
"upload-rate-limit": null
},
"relationships": {
"venue": {
"data": {
"type": "venues",
"id": "22222222-2222-2222-2222-222222222222"
}
}
}
}
],
"meta": {
"count": 1
},
"jsonapi": {
"version": "1.0"
}
}