From f34f1ae793f559d07464e95a900d14a7a2fd5bae Mon Sep 17 00:00:00 2001 From: Jason SECULA Date: Thu, 26 Feb 2026 13:37:00 +0100 Subject: [PATCH] Added GetTagDevices --- AirwatchAPI.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AirwatchAPI.py b/AirwatchAPI.py index 46b546d..6d9bc8c 100644 --- a/AirwatchAPI.py +++ b/AirwatchAPI.py @@ -73,6 +73,18 @@ class AirwatchAPI: return devices return None + def GetTagDevices(self, tagID): + cmdURI = f"/api/mdm/tags/{tagID}/devices" + airwatchHeaders = self.GetHeaders(cmdURI) + uri = f"{self.Server}{cmdURI}" + result = requests.get(uri, headers=airwatchHeaders) + devices = [] + if(result.status_code == 200): + for dev in result.json()["Device"]: + devices += [dev["DeviceId"]] + return devices + return [] + def GetDeviceApps(self, device): cmdURI = f"/api/mdm/devices/{device.Uuid}/apps/search" airwatchHeaders = self.GetHeaders(cmdURI)