2017-05-24 80 views
0

呼叫Intune的蔚蓝图形API来创建deviceCompliancePolicyState返回400错误的请求

GET https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/ 

响应

{ 
     "@odata.context": "https://graph.microsoft.com/beta/$metadata#managedDevices/$entity", 
     "id": "dd9615c4-9d3b-4ece-9272-34a10e8fe908", 
     "userId": null, 
     "deviceName": "iPad Feb23", 
     "hardwareInformation": { 
     "serialNumber": null, 
     "totalStorageSpace": 0, 
     "freeStorageSpace": 0, 
     "imei": "", 
     "meid": null, 
     "manufacturer": null, 
     "model": null, 
     "phoneNumber": null, 
     "subscriberCarrier": null, 
     "cellularTechnology": null, 
     "wifiMac": null, 
     "operatingSystemLanguage": null, 
     "isSupervised": false, 
     "isEncrypted": false, 
     "isSharedDevice": false, 
     "sharedDeviceCachedUsers": [] 
     }, 
     "ownerType": "personal", 
     "deviceActionResults": [], 
     "managementState": "managed", 
     "enrolledDateTime": "2017-05-24T13:10:20.8964572Z", 
     "lastSyncDateTime": "2017-05-24T15:16:02.6465376Z", 
     "chassisType": "tablet", 
     "operatingSystem": "iOS", 
     "deviceType": "iPad", 

    "complianceState": "compliant", 
    "jailBroken": "False", 
    "managementAgents": 2, 
    "managementAgent": "mdm", 
    "osVersion": "9.3.5", 
    "easActivated": false, 
    "easDeviceId": null, 
    "easActivationDateTime": "0001-01-01T00:00:00Z", 
    "aadRegistered": null, 
    "enrollmentType": "userEnrollmentWithServiceAccount", 
    "lostModeState": "disabled", 
    "activationLockBypassCode": null, 
    "emailAddress": null, 
    "azureActiveDirectoryDeviceId": "00000000-0000-0000-0000-000000000000", 
    "deviceRegistrationState": "registered", 
    "deviceCategoryDisplayName": null, 
    "isSupervised": false, 
    "exchangeLastSuccessfulSyncDateTime": "0001-01-01T00:00:00Z", 
    "exchangeAccessState": "none", 
    "exchangeAccessStateReason": "none", 
    "remoteAssistanceSessionUrl": "", 
    "isEncrypted": false, 
    "model": null, 
    "manufacturer": null 
} 

但是,当我尝试做后似乎没有任何工作...根据这里的文档https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_create

它应该很好,这个电话的问题是什么......?

呼叫

POST https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/deviceCompliancePolicyStates/ 

{ 
    "@odata.type": "#microsoft.graph.deviceCompliancePolicyState", 
    "settingStates": [ 
    { 
     "@odata.type": "microsoft.graph.deviceCompliancePolicySettingState", 
     "setting": "Setting value", 
     "instanceDisplayName": "Instance Display Name value", 
     "state": "notApplicable", 
     "errorCode": 9, 
     "errorDescription": "Error Description value", 
     "userPrincipalName": "User Principal Name value", 
     "sources": [ 
     { 
      "@odata.type": "microsoft.graph.settingSource", 
      "id": "Id value", 
      "displayName": "Display Name value" 
     } 
     ] 
    } 
    ], 
    "displayName": "Display Name value", 
    "version": 7, 
    "platformType": "androidForWork", 
    "state": "notApplicable", 
    "settingCount": 12 
} 

反应

{ 
    "error": { 
    "code": "No method match route template", 
    "message": "No OData route exists that match template ~/entityset/key/navigation with http verb POST for request /StatelessDeviceConfigurationFEService/managedDevices('dd9615c4-9d3b-4ece-9272-34a10e8fe908')/deviceCompliancePolicyStates.", 
    "innerError": { 
     "request-id": "544c4ee2-a6de-4203-9c30-c3e589b77713", 
     "date": "2017-05-24T15:48:30" 
    } 
    } 
} 

回答

0

我在微软Intune的团队的Microsoft Graph和Microsoft Intune的之间的整合,尤其致力于工程师。

在这种情况下,它看起来像文档存在问题,因为deviceCompliancePolicyState实体无法创建,它是显示设备合规性策略状态的只读实体。我将努力纠正文档。如果您可以通过创建deviceCompliancePolicyState实体让我知道您尝试完成的场景,那么我可能会将您指向正确的方向。

希望帮助

彼得

+0

我工作的定制威胁defnece连接器有点事(https://docs.microsoft.com/en-us/intune-classic/deploy-use/mobile - 威胁防御),我有一个设备上的自定义应用程序,检查恶意软件,... MITM ....并且当它检测到一些恶意活动时,我会将deviceCompliancePolicy设置为“nonComliant”,以便条件访问踢并处理其余部分,即阻止设备访问服务。我试图联系支持多次,我们如何能够做到这一点,但无济于事... – user3826273

+0

你能指点我现在正确的方向吗? https://stackoverflow.com/questions/44176353/an-azure-app-how-to-send-device-threat-info-to-microsoft-intune – user3826273

相关问题