List Devices¶
-
GET
/sk-api/v1/devices
¶ Get a list of devices.
- Request Headers
Authorization – The client’s Authorization header.
- Query Parameters
tenantCode – (optional) Filter by devices registered to the specified tenant.
managingOrgCode – (optional) Filter by devices registered to tenants under the specified managing organization.
cursor – (optional) String value used to navigate result pagination.
- Status Codes
200 OK –
Query successful.
- Response Data
devices – A list of devices.
nextCursor – 100 results are returned at a time. If more are available, this string value can be used to query the next set of results. If no more results are available, this value will be missing.
Each entry in devices is a JSON representation of a device from Skykit Admin.
- Device
chromeWebviewVersion – The version of Chrome used to run webview content on a device.
connectionType – The type of physical connection the device uses to connect to the internet.
contentManagerDisplayName – The device’s name in Skykit Content Manager.
contentManagerLocation – The device’s location in Skykit Content Manager.
contentPending – The name of the pending media item set to play next, if any.
controlVersionName – The device’s custom admin app version (Android only). If none, app is either not installed, or an older version is installed that does not report its version.
created – The date when the device was created inside of Skykit.
defaultHomeApp – Default device home app type and version.
displayRatio – The device’s display ratio when rendering content.
ethernetMacAddress – The device’s ethernet MAC address.
heartbeatUpdated – The last time that the device made a successful heartbeat request. A “heartbeat” is a snapshot of a device’s state, posted to Skykit every few minutes.
homeVersionName – The device’s custom home screen app version (Android only). If none, app is either not installed, or an older version is installed that does not report its version.
hoursOfOperation – The hours during the day when proof of play logs will captured.
id – The device’s unique identifier.
lastPlayedContentName – The name of the last piece of content reported by this device.
launcherVersionName – The device’s legacy custom home screen app version (Android only). If none, app is either not installed, or an older version is installed that does not report its version.
macAddress – The active MAC address of this device.
managingOrgCode – The unique identification code of the managing organization to which this device belongs.
managingOrgName – The name of the managing organization to which this device belongs.
model – The device’s hardware model.
notes – User-supplied notes pertaining to this device.
online – A boolean indicating whether the device is currently online (
true
) or offline (false
).orientation – The device’s orientation:
vertical
orhorizontal
.os – The device’s operating system.
osVersion – The operating system version.
serialNumber – The device’s serial number.
skykitPlayerVersion – The version of the Skykit player running on this device (both Android and Chrome).
streamSpeed – Content download speed in Mbps.
tenantCode – The unique identification code of the tenant to which this device belongs.
tenantName – The name of the tenant to which this device belongs.
timezone – The device’s timezone setting.
usageType – Description field to indicate how the device is to be used inside of Skykit.
wifiSsid – The name of the network to which the device is currently connected.
Request parameters invalid.
- Response Data
message – A human-readable message explaining what went wrong.
Authorization headers invalid.
- Response Data
message – Unauthorized for URL.
Something was wrong in the authentication headers.
- Response Data
message – Insufficient permission.
Example request:
GET /sk-api/v1/devices HTTP/1.1
Example response:
HTTP/1.1 200 OK Content-Type: application/json
{ "devices": [ { "connectionType": "WiFi", "contentManagerDisplayName": "Test Display", "contentManagerLocation": "Office", "contentPending": "", "controlVersionName": null, "created": "2019-04-20T15:20:24.023Z", "displayRatio": "16:9", "heartbeatUpdated": "2019-06-20T16:16:16.890Z", "homeVersionName": null, "hoursOfOperation": { "mon": {"startTime": "07:00", "endTime": "18:00"}, "tue": {"startTime": "07:00", "endTime": "18:00"}, "wed": {"startTime": "07:00", "endTime": "18:00"}, "thu": {"startTime": "07:00", "endTime": "18:00"}, "fri": {"startTime": "07:00", "endTime": "18:00"}, "sat": {"startTime": "10:00", "endTime": "19:00"}, "sun": {"startTime": "10:00", "endTime": "16:00"}, "excludeDates": [ "2019-01-08", "2019-11-28", "2019-12-25" ] }, "id": "a4e9e20dc0614df99a86bc3223c7c6c4", "lastPlayedContentName": "video 2", "launcherVersionName": "136.1.1", "macAddress": "3g3gh6wf5twg", "managingOrgCode": "skykit", "managingOrgName": "Skykit", "model" "ASUS Chromebox CN60", "notes": "", "online": true, "orientation": "horizontal", "os": "cros", "osVersion": "74.0.3729.159", "serialNumber": "SN0010287", "skykitPlayerVersion": "113.0.1", "streamSpeed": 3, "tenantCode": "skykit_example_tenant", "tenantName": "Skykit Example Tenant", "timezone": "US/Central", "usageType": "Installed" }, { "connectionType": "WiFi", "contentManagerDisplayName": "News Stand", "contentManagerLocation": "Lobby", "contentPending": "Current Events", "controlVersionName": "com.skykit.control not installed", "created": "202--03-20T15:20:24.098Z", "displayRatio": "16:9", "heartbeatUpdated": "2020-04-20T16:16:16.465Z", "homeVersionName": "com.skykit.home not installed", "hoursOfOperation": null, "id": "e8d07b43bdfa4fd78996ae1e43759910", "lastPlayedContentName": "Current Events", "launcherVersionName": "132.0.0", "macAddress": "3g3gh6wf5twg", "managingOrgCode": "skykit", "managingOrgName": "Skykit", "model": "ASUS Chromebox CN62", "notes": "Do not unplug", "online": true, "orientation": "vertical", "os": "cros", "osVersion": "74.0.3729.159", "serialNumber": "SN0008296", "skykitPlayerVersion": "113.0.1", "streamSpeed": 1, "tenantCode": "skykit_example_tenant", "tenantName": "Skykit Example Tenant", "timezone": "US/Eastern", "usageType": "Installed" } ], "nextCursor": "HA4TONXKGYYTEMI=" }
Example usage:
from sign_jwt import make_headers # see: Authentication from tqdm import tqdm # for progress bar, if desired import requests BASE_URI = 'https://skykit-provisioning.appspot.com' LIST_DEVICES_ENDPOINT = 'sk-api/v1/devices' URI = '{}/{}'.format(BASE_URI, LIST_DEVICES_ENDPOINT) def list_devices(tenant_code=None, managing_org_code=None, tqdm=None): headers = make_headers() params = {} if tenant_code: params['tenantCode'] = tenant_code if managing_org_code: params['managingOrgCode'] = managing_org_code if tqdm: pbar = tqdm() cursor = '' devices = [] while True: response = requests.get(URI, headers=headers, params=params) response.raise_for_status() devices_page = response.json()['devices'] devices += devices_page if tqdm: pbar.update(len(devices_page)) cursor = content.get('nextCursor') if cursor: params['cursor'] = cursor else: break return devices example_devices = list_devices(tenant_code='skykit_example_tenant', tqdm=tqdm)