我正在尝试下载/上传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"
}
}
}我是不是没有正确地理解文档,或者我还有什么地方做错了?谢谢你的帮助。
发布于 2018-01-10 06:37:21
@Tobi快速查看答案跳过直到您看到 answer
正如您所说的那样,完整的应用程序列表及其元数据可以通过以下方式获得:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps这样你就会得到一个mobileLobApps和managedMobileLobApps的列表。例如:
{ "@odata.type":"#microsoft.graph.androidLobApp","id":"","displayName":"TestApp.apk","description":"TestApp.apk","publisher":"testPublisher","largeIcon":null,"createdDateTime":"","lastModifiedDateTime":"","isFeatured":false,"privacyInformationUrl":null,"informationUrl":null,"owner":null,"developer":null,"notes":null,"uploadState":1,"committedContentVersion":"2","fileName":"TestApp.apk","size":1262448,"identityVersion":"110","identityName":"","minimumSupportedOperatingSystem":{ "v4_0":true,"v4__3":false,"v4_1":false,"v4_2":false,"v4_3":false,"v4_4":false,"v5_0":false,"v5_1":false },"versionName":null,"versionCode":"“},
- A managedMobileLobApp metadata{ "@odata.type":"#microsoft.graph.managedIOSLobApp","id":"","displayName":"","description":"","publisher":"","largeIcon":null,"createdDateTime":"","lastModifiedDateTime":“<日期/时间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-狗粮“,"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)。
ANSWER:如果应用程序是非托管的,则以下调用将为您提供contentVersions
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.raph.mobileLobApp/contentVersions
否则,如果应用程序是托管的,那么:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.graph.managedMobileLobApp/contentVersions
原因:调用应该使用基本类型(mobileLobApp或managedMobileLobApp)以及应用程序的派生类型:
(如果你需要知道所有支持的应用程序类型的图表模式,请转到此处enter link description here)
附注:在您提交问题时,上面的调用已经中断。然而,@Andrei Fedorov给出的解决方案一直在发挥作用。
发布于 2017-12-21 21:40:53
尝试使用以下请求:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.graph.windowsMobileMSI/contentVersions例如,您可以获取第一个文件内容
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/42454cd8-cba9-4946-bae2-b66e7ca54799/microsoft.graph.windowsMobileMSI/contentVersions/1/files我设法获得了内容文件的列表,但是我未能上传我的MSI文件或更新现有文件内容。
发布于 2017-11-10 06:46:48
这是有效的错误。我们正在努力支持这一点。看起来我们错过了添加路由规则来在一些基本类型的移动应用程序上支持它。谢谢你的报告。我们将在接下来的几周内修复它。
https://stackoverflow.com/questions/45765028
复制相似问题