Example device groups API scenario

You can use the device group APIs to calculate device group characteristics, such as the percentage of Android Enterprise-enrolled devices. Remember that device groups are “device groups” on Ivanti Neurons for MDM, and “labels” on Ivanti EPMM.


1. First, use the Get all Device Groups call to get a list of all the device groups, so you know which device groups you can use for your calculations.



GET msa/v1/cps/rule



    "searchResults": [
            "id": 38000, 
            "name": "All Devices", 
            "description": "Targets any type of device."
            "id": 38001, 
            "name": "Android Devices", 
            "description": "Targets all Android devices", 
            "definition": "PLATFORMTYPE EQ 'ANDROID'"
            "id": 38002, 
            "name": "Android Enterprise Devices", 
            "description": "Targets all Android Enterprise devices", 
            "id": 38003, 
            "name": "iOS Devices", 
            "description": "Targets all iOS devices", 
            "definition": "PLATFORMTYPE EQ 'IOS'"
            "id": 38004, 
            "name": "Windows Devices", 
            "description": "Targets all Windows devices", 
            "definition": "PLATFORMTYPE EQ 'WINDOWS_PHONE'"
            "id": 38005, 
            "name": "macOS Devices", 
            "description": "Targets all OSX devices", 
            "definition": "PLATFORMTYPE EQ 'OSX'"
            "id": 38006, 
            "name": "tvOS Devices", 
            "description": "Targets all tvOS devices.", 
            "definition": "PLATFORMTYPE EQ 'IOS' AND MODEL STARTS_WITH 'AppleTV')"
    "results": 7, 
    "offset": 0, 
    "limit": 50
2. Use the Count devices by device group identifier call to find the total android device count.



GET : /msa/v1/cps/device?ruleId=38001


Note that ruleId 38001 targets all Android devices.


3. Use the Count devices by device group identifier and then the number of Android Enterprise-enrolled devices.



GET : /msa/v1/cps/device?ruleId=38002


Note that ruleId 38002 targets all Android Enterprise-enrolled devices.


4. Using the two values returned by the preceding two calls, you can calculate the percentage of Android devices that are also Android Enterprise-enrolled devices.