我正在开发一个公司应用程序,使用Microsoft Graph从公司的云服务中提取数据。此刻,我正在尝试使用Graph Intune API(/ deviceAppManagement / mobileApps)获取公司应用程序列表。
但是,它不会返回每个应用程序图标的地址,并且它们都是空的。这些图标在Intune门户中设置,并在公司门户应用程序中正确显示。我有什么方法可以拥有这些图标吗?
答案 0 :(得分:0)
@Jason_wun
总结:如果我们正确设置徽标,我们应该使用 base64 encoded 字符串获取largeIcon。
详细说明:
首先让我们验证徽标是否已正确上传。 (我确定 您已正确完成,因为您在公司门户中看到了它 应用程序,但只是为了完整性。)
现在让我们进行GET调用以获取图标以及其他与应用相关的元数据
{
"@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+ggTmpe7o9nnIkGVXCWllWZV6oi4Vip3SjDUWT0Zc6twVNjd2BhuYNuVu0ed1Zg63e6sSXNWq4ngO9gcbmbO5O2VWmq2i4LNpEys6SUbXUrUBXeFB3b6CxeVvuNlLme52UJmaZ/0F3e6CxOa5bHRUJPSklOedIQ2YoO6FbcAONzQu6w2T0UK5etVSlletaQ27x6r0tNizHxtmW7u5AQ7OlW7wKZdLqO1B0y3FBJbTblW6P656Dhosnk6onPseYlJmW2H2uqFLMs8fqDpYbVkvuKeeo7u2BRuWFZELeB3VDoW4o1A2FuqFQNxTqhkLdUKgbCnVDoW4o1A3lKrobL7CuCHVDoW4o1A1lV3dvp9LWRqrls0AykyqF/VDmA4NtIjaXJjpgo4LX7b5WXOILw7ZunWRl+UC1Ls8UFZ3Pa8lIuztjM1bQPte6m4O4szEgm7p1jrLK8mKquvNiEhU6c51sNbEsOHt2Qon4NjWkQunDn+A4RDkd6TqaC/QEjslLund3Ksnkg4u61KKsVcm6QigKFVYj1BpD+97J3WWNJXxynPPmMsGCzn4tY+8EbOhe/PkKJdbAdDEe+7fK7FVmkvCXdkBn+qu6r7y6Cy4/259ngs236PaDhArrEa7BXu4uCUTnmxePmpCYhsrsz+tOhHtpqBDrm79Nlz8hh17cL94qK8ts1HdAbf5It0fthfr9FhfWnSfV2alkM3oq9xupzutOi7V27MaLuhP+SWv5/Wp0SF7N3f+Zls1PhLqhUDcU6oYyiO6/AnVDoW4o1A2FuqFQNxTqhkLdUKgbyp5ufdU69nvNy0DdUKgbyindZqfTl9vrFEL5jf+h/zb18RzXrS/vDPoerxHKaNtO+C9dOod1a4F+k50X6qy72Cz2ta60NrrD998/4/uo7vVqV9SdfWXtyxo1pDvb5qM5qLvlVGieCFdI3dSN5aRuL3WmdSZ8GXUfzt3FtxrKO30nt3jf9d+mPpGjumuJRaKtkHFJ3Sd0J8LeKuvKPMAk3FMOde/rJm+FuqFQNxTqhkLdUKgbCnVDoW4o1A2FuqFQNxTqhkLdUKgbCnVDoW4o1A2FuqFQNxTqhkLdUKgbCnVDoW4g39//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"
}
总之,为了获得图像,我们需要解码largeIcon的base64编码值。
旁注:如果您只想获取图标信息(不包括其他应用元数据,则以下调用可能会有所帮助。
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/<GUID of the app's Id here>?$select=largeIcon