How to retrieve install status for specific app in Intune Graph API

JamesEdmondsUKPN 5 Reputation points
2023-08-30T16:10:51.8533333+00:00

We have for some time, been using the below to retrieve the install status for a specific app across all devices:

https://graph.microsoft.com/$graphApiVersion/deviceAppManagement/mobileApps/$ApplicationID/devicestatuses


This no longer seems to work, and gives us a 400 bad request. We assume this is because we are using the beta version, but were wondering if there is a replacement method we can use to achieve the same thing?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,273 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,202 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Crystal-MSFT 49,426 Reputation points Microsoft Vendor
    2023-08-31T01:54:05.64+00:00

    @JamesEdmondsUKPN, Thanks for posting in Q&A. Based on my log capturing from Edge DevTool, I find the following method to get the device install status for one specific win32 app.

    User's image

    And when using Graph explorer to get the information, we can try the following:

    Action: POST

    Version: Beta

    URL: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 '<your app id>')",
        "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. msft-gu 1,355 Reputation points
    2023-08-30T17:35:35.39+00:00

    Hi,

    Thank you for your question. I reproduce this on my environment using:

    GET https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps/{ID}/deviceStatuses
    

    But I also encountered the same error which is Bad Request - 400 "Resource not found for the segment 'deviceStatuses'.

    I checked the documentation and cannot locate it also. It may have been removed since it is under beta.

    Important: Microsoft Graph APIs under the /beta version are subject to change; production use is not supported.

    I suggest providing feedback on the documentation itself to put alternatives for deviceStatuses or to further verify if they have removed it.


    If I answered your question, please upvote and accept this as answer.

    0 comments No comments

  3. JamesEdmondsUKPN 5 Reputation points
    2023-11-13T15:37:38.7066667+00:00

    I've made some progress on this;

    I have a script built that queries the following URL: https://graph.microsoft.com/beta/deviceManagement/reports/getDeviceInstallStatusReport

    It uses a body of:

    $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 '$ApplicationID')"
    	orderBy = @(
    	)
    }
    
    

    With type POST and ContentType "application/json"

    I get some data back, but am struggling to handle it.

    I find that I am unable to directly call the .Values property of the resulting PSObject, as per my SO post here:

    https://stackoverflow.com/questions/77473264/how-does-invoke-restmethod-parse-a-json-response-into-a-ps-object

    I am also curious, as the data is contained within the Values property, it has not field names of column headings in it. That is all stored in another property called Schema.

    How can I take the column headings from the Schema property, and associate them with the arrays of values in the Values property?

    Thanks

    James


  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

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