使用microsoft graph api将应用程序与appProtection策略相关联会产生错误的请求响应

时间:2017-10-09 06:37:06

标签: microsoft-graph

调用端点

https://graph.microsoft.com/beta/deviceAppManagement/androidManagedAppProtections/{appProtectionPolicyId}/mobileAppIdentifierDeployments

身体

{
    "@odata.type": "#microsoft.graph.mobileAppIdentifierDeployment",
    "mobileAppIdentifier": {
        "@odata.type": "microsoft.graph.mobileAppIdentifier"
    },
    "id": "com.microsoft.office.outlook.android",
    "version": "1146701235"
}

返回400 Bad Request回复:

"error": {
    "code": "No method match route template",
    "message": "No OData route exists that match template ~/singleton/navigation/key/navigation with http verb POST for request /MAMAdmin/MAMAdminFEService/deviceAppManagement/androidManagedAppProtections('T_6c3e5440-9a81-4f8b-88dd-1e83c9e6bc1f')/mobileAppIdentifierDeployments.",
    "innerError": {
        "request-id": "8b8579c6-6992-46c0-8222-b1fbd13388e4",
        "date": "2017-10-09T06:34:34"
    }
}

我在请求中缺少什么?

1 个答案:

答案 0 :(得分:1)

端点应为updateMobileAppIdentifierDeployments而不是mobileAppIdentifierDeployments

POST https://graph.microsoft.com/beta/deviceAppManagement/androidManagedAppProtections/{androidManagedAppProtectionId}/updateMobileAppIdentifierDeployments

请求正文也缺少完整的mobileAppIdentifierDeployments对象:

{
    "mobileAppIdentifierDeployments": [
      {
        "@odata.type": "#microsoft.graph.mobileAppIdentifierDeployment",
        "mobileAppIdentifier": {
          "@odata.type": "microsoft.graph.androidMobileAppIdentifier"
        },
        "id": "5a77f582-f582-5a77-82f5-775a82f5775a",
        "version": "Version value"
      }
    ]
}

此方法记录在@ updateMobileAppIdentifierDeployments action