3

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

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

4

3 回答 3

3

@Tobi 要快速查看答案,请跳过直到看到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>"
    },
    
    • managedMobileLobApp 元数据

       {
       "@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)等...

(如果您需要了解所有支持的应用程序类型的图形架构,请在此处输入链接描述

附带说明:当您提交问题时,上述电话已中断。但是,@Andrei Fedorov 给出的解决方案一直有效。

于 2018-01-09T22:37:21.253 回答
0

尝试使用以下请求:

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-12-21T13:40:53.170 回答
-1

这是有效的错误。我们正在努力支持这一点。看起来我们错过了在某些基本类型的移动应用程序上添加路由规则来支持它。感谢您的报告。我们将在接下来的几周内修复它。

于 2017-11-09T22:46:48.250 回答