Querying App Installation Status on Intune via Microsoft Graph API

Sara Caballero 40 Reputation points
2024-03-05T09:39:35.3066667+00:00

I am attempting to use the Microsoft Graph API to determine the number of installations for a managed app on Intune, as guided by the documentation provided here: Using the Microsoft Graph API for Intune.

According to the documentation, the process involves:

  1. Retrieving a list of devices registered to a user from Azure Active Directory (/beta/users/{user}/ownedDevices).
  2. Viewing the list of applications for my tenant (/beta/deviceAppManagement/mobileApps).
  3. Using the application ID to determine the installation state for the application (/beta/deviceAppManagement/mobileApps/{id}/deviceStatuses/).

However, when attempting the last step to determine the installation state for an application, I receive the following error:

{
    "error": {
        "code": "BadRequest",
        "message": "Resource not found for the segment 'deviceStatuses'.",
        "innerError": {
            "date": "2024-03-05T09:28:17",
            "request-id": "62770404-6e5a-4ccb-9378-95dc65066afb",
            "client-request-id": "0cc59869-1b6d-1621-191e-63669a2ff226"
        }
    }
}

Could you please provide guidance or an alternative method to achieve the same result? It seems there might have been changes or updates in the API that are not reflected in the current documentation.

Thank you for your assistance.

Microsoft Security | Intune | Application management
Microsoft Security | Intune | Other
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. Crystal-MSFT 54,176 Reputation points Microsoft External Staff
    2024-03-06T03:48:13.03+00:00

    @Sara Caballero Thanks for posting in Q&A. For the API /beta/deviceAppManagement/mobileApps/{id}/deviceStatuses/, the properties for the installation state of a mobile app for a device are deprecated in May, 2023. So you get error when query.

    https://free.blessedness.top/en-us/graph/api/resources/intune-apps-mobileappinstallstatus?view=graph-rest-beta

    Now we use the following query to get the app installation status report.

    Action POST

    https://graph.microsoft.com/beta/deviceManagement/reports/getDeviceInstallStatusReport

    Request Body:

    {
        "select": [
            "DeviceName",
            "UserPrincipalName",
            "Platform",
            "AppVersion",
            "InstallState",
            "InstallStateDetail",
            "AssignmentFilterIdsExist",
            "LastModifiedDateTime",
            "DeviceId",
            "ErrorCode",
            "UserName",
            "UserId",
            "ApplicationId",
            "AssignmentFilterIdsList",
            "AppInstallState",
            "AppInstallStateDetails",
            "HexErrorCode"
        ],
        "skip": 0,
        "top": 50,
        "filter": "(ApplicationId eq 'c24ef1b7-7f84-4976-869c-1cdae0b32983')",
        "orderBy": []
    }
    

    User's image

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Greg Hall 0 Reputation points
    2024-03-05T10:10:17.4433333+00:00

  2. ADT Pavel MATIN 0 Reputation points
    2024-10-25T16:16:09.5266667+00:00

    hi

    there is a none BETA API with the same result :

    https://graph.microsoft.com/v1.0/deviceManagement/reports/exportJobs

    body

    {

    "reportName": "DeviceInstallStatusByApp",

    "filter": "(ApplicationId eq 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')",

    "format": "json",

    "select": [

    "DeviceName",
    
    "LastModifiedDateTime",
    
    "UserPrincipalName",
    
    "DeviceId",
    
    "AppInstallState"
    

    ]

    }

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.