jason_wun
jason_wun

Reputation: 113

Microsoft Graph Intune: How to get the icons of company apps

I'm developing an company app that pulls the data from company's cloud services using Microsoft Graph. At this moment I'm trying to get the list of the company apps using the Graph Intune API which is /deviceAppManagement/mobileApps.

However, it does not return the address of the icon of each of the apps and they are all null. The icons were set in Intune portal and they are displayed properly in Company Portal App. Is there any way that I can have those icons?

enter image description here

Upvotes: 2

Views: 1719

Answers (1)

ranga
ranga

Reputation: 56

@Jason_wun

In summary: If we set the Logo properly we should get the largeIcon with base64 encoded string.

In detail:

  1. First let us verify whether the Logo is uploaded properly. (I'm sure you have done it correctly, because you see it in Company Portal app, but just for the sake of completeness).

    • In portal.azure.com go to, Intune-> Mobile apps -> Apps
    • Select the app you want to update/add the icon, then go to Properties -> App information -> Logo
    • Upload the Logo there (I used an PNG format to reproduce this scenario).
    • We should get the message "Upload Completed for " for successful uploads.
  2. Now let's make the GET call to obtain the icon as well as other app related metadata


{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceAppManagement/mobileApps/$entity",
"@odata.type": "#microsoft.graph.androidLobApp",
"id": "xxxxxxxx-xxxx-xxxx-GUID-SAMPLExHEREx",
"displayName": "<Display name of your app>",
"description": "<Some description>",
"publisher": "<publisher name>",
"largeIcon": {
    "type": "image/png",
    "value": "iVBORw0KGgoAAAANSUhEUgAAAHoAAABtCAIAAADh6OKQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAQASURBVHhe7ZzteaswDEY7FwNlnkyTZTJMrw2SLQkbAs19a9L3/CqWP+qDEQX89OubAKFuKNQNhbqhUDcU6oZC3VCoGwp1Q6FuKNQNhbqhUDcU6oZC3VCoGwp1Q6FuKNQN5Uq6H7evzO0hxxfkBd3P+zRPc7o/peSXoG4o1A1l+UV+/df4Ced0Px/327SUJqbp5hQ8U7CE7g8TmttJaGlXozJMGuX5KJ27nle6+wONygndeuzpR/Xib7fbC3eTR3+ggTmpe7o9nnIkGVX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kLdUKgbCnVDoW4g39//AGOcjUiB9dTTAAAAAElFTkSuQmCC"
},
"createdDateTime": "2018-01-09T23:08:32.1089504Z",
"lastModifiedDateTime": "2018-01-09T23:41:37.5000422Z",
"isFeatured": true,
"privacyInformationUrl": null,
"informationUrl": null,
"owner": "",
"developer": "",
"notes": "",
"uploadState": 1,
"committedContentVersion": "2",
"fileName": "<Your app file name>",
"size": 4426224,
"identityVersion": "103185025",
"identityName": "<reversed domain name type>",
"minimumSupportedOperatingSystem": {
    "v4_0": true,
    "v4_0_3": false,
    "v4_1": false,
    "v4_2": false,
    "v4_3": false,
    "v4_4": false,
    "v5_0": false,
    "v5_1": false
},
"versionName": "10.3.185.25",
"versionCode": "103185025"

}


  1. In the response JSON above, the icon data can be obtained from the "value" of "largeIcon" property. The important thing to know is that, the string given under value of largeIcon is not the address of the icon but rather the actual image data encoded with base64 format.
  2. In this example response the the value mentioned here is from an actual image which can be seen with a base64 decoder.
    • To see the image quickly just copy the value of largeIcon and go to: decodebase64.com
    • Paste the string in the text box with caption "Base64 (automatically decoded)"
    • Under "Options" click "Decode as Image"
    • You will see an image with text "Jason's sample Icon" :)

In summary to obtain the image we need to decode the base64 encoded value of largeIcon.

On a side note: If you want to get the icon information only (excluding the other app metadata the following call might be helpful.

https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/<GUID of the app's Id here>?$select=largeIcon

Upvotes: 1

Related Questions