gpt4 book ai didi

azure-active-directory - Intune 图形 API 错误

转载 作者:行者123 更新时间:2023-12-04 00:18:09 28 4
gpt4 key购买 nike

我正在尝试下载/上传 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"
}
}
}

我是不是没有正确理解文档,还是我做错了什么?感谢您的帮助。

最佳答案

@托比 要快速查看答案,请跳过直到看到 ANSWER


正如您所说的那样,完整的应用列表及其元数据可以通过以下方式获取:

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)
  • windowsMo​​bileMSI(基础 mobileLobApp)
  • managedAndroidStoreApp(基础 managedMobileLobApp)等等……

(如果您需要了解所有支持的应用程序类型的图形架构,请转到此处 enter link description here)

旁注:当您提交问题时,上述调用已中断。然而,@Andrei Fedorov 给出的解决方案一直有效。

关于azure-active-directory - Intune 图形 API 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45765028/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com