我正在尝试下载/上传Intune移动应用的MSI。
我可以使用以下方法获取应用列表:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
我还可以使用以下方法获取单个移动应用程序的详细信息:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/
但是使用以下调用获取移动应用程序的内容版本将失败:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/contentVersions
要么
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.graph.managedMobileLobApp/contentVersions
要么
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.graph.mobileLobApp/contentVersions
该文档说,所有三个版本均应工作:https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_apps_managedmobilelobapp_list_mobileappcontent
但是我总是得到错误:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'contentVersions'.",
"innerError": {
"request-id": "94029de8-0bd4-4726-9138-d3c785e91be3",
"date": "2017-08-18T20:58:50"
}
}
}
要么
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/singleton/navigation/key/cast/navigation with http verb GET for request /StatelessAppMetadataFEService/deviceAppManagement/mobileApps('42454cd8-cba9-4946-bae2-b66e7ca54799')/$/microsoft.management.services.api.managedMobileLobApp/contentVersions.",
"innerError": {
"request-id": "b1167613-6f5e-409d-835d-e2774d58e14a",
"date": "2017-08-18T20:59:14"
}
}
}
我是否不正确地理解文档,或者我做错了什么?感谢您的帮助。
最佳答案
@托比
快速跳过答案,直到看到答案
正如您正确指出的那样,完整的应用列表及其元数据可以通过以下方式获取:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
这样,您将获得mobileLobApps和managedMobileLobApps的列表。
例如:
mobileLobApp元数据
{
"@odata.type": "#microsoft.graph.androidLobApp",
"id": "<the GUID for mobileLobApp>",
"displayName": "TestApp.apk",
"description": "TestApp.apk",
"publisher": "testPublisher",
"largeIcon": null,
"createdDateTime": "<some date>",
"lastModifiedDateTime": "<some date>",
"isFeatured": false,
"privacyInformationUrl": null,
"informationUrl": null,
"owner": null,
"developer": null,
"notes": null,
"uploadState": 1,
"committedContentVersion": "2",
"fileName": "TestApp.apk",
"size": 1262448,
"identityVersion": "110",
"identityName": "<some test app info>",
"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": null,
"versionCode": "<version info here>"
},
托管的MobileLobApp元数据
{
"@odata.type": "#microsoft.graph.managedIOSLobApp",
"id": "<the GUID for managedMobileLobApp>",
"displayName": "<Display name of the managed App>",
"description": "<desc>",
"publisher": "<publisher>",
"largeIcon": null,
"createdDateTime": "<date time info>",
"lastModifiedDateTime": "<date/time info>",
"isFeatured": false,
"privacyInformationUrl": "",
"informationUrl": null,
"owner": "",
"developer": "",
"notes": "",
"uploadState": 1,
"appAvailability": "lineOfBusiness",
"version": "\"398c8e35-60db-4f07-a424-e17484a48f30\"",
"committedContentVersion": "1",
"fileName": "Excel_DF_2_4_17070200.ipa",
"size": 138493616,
"identityVersion": "2.4.17070200",
"bundleId": "com.microsoft.Office.Excel-dogfood",
"applicableDeviceType": {
"iPad": true,
"iPhoneAndIPod": true
},
"minimumSupportedOperatingSystem": {
"v8_0": false,
"v9_0": true,
"v10_0": false,
"v11_0": false
},
"expirationDateTime": "2017-12-05T23:55:42Z",
"versionNumber": null,
"buildNumber": "2.4.17070200"
},
就您而言,您可以通过以下方法简单地获取特定应用的应用元数据:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799
从上述GET调用的响应中,您可以通过查看@ odata.type来确定该应用程序是否受管理(managedMobileLobApp)(受管理的MobileLobApp)。
回答:
如果该应用不受托管,则以下调用将为您提供contentVersions
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799
/microsoft.graph.mobileLobApp/contentVersions
否则,如果该应用程序是托管的,则:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799
/microsoft.graph.managedMobileLobApp/contentVersions
原因:该调用应与基础(mobileLobApp或managedMobileLobApp)以及应用程序的派生类型一起使用:
androidLobApp(基本mobileLobApp)
iosStoreApp(基本mobileLobApp)
WindowsMobileMSI(基本mobileLobApp)
managedAndroidStoreApp(基于managedMobileLobApp的基础)
等等...
(如果您需要了解所有受支持的应用程序类型的图形架构,请在此处enter link description here)
附带说明:在您提交问题时,上述通话已中断。但是,@ Andrei Fedorov提供的解决方案一直都在工作。