Kony Management User Guide: Intelligent EMM (IEMM) > Policy Information

Policy Information

This is a query base service. On the basis of query parameter and corresponding expression, the system responds to the user with relevant output.

URL

https://emmserver.com/emm/iemm/services/policy

Type

POST

Input

Input Parameters

deviceid

This is a mandatory parameter to authenticate a user.

query

This is a mandatory parameter and its possible values are:

queryexpression

Input Headers

Content-Type

This is a mandatory parameter and allowed value is application/x-www-form-urlencoded.

Accept

This is an optional parameter. The default value is application/xml, and the possible values are application/xml or application/json.

Cookie

This is a mandatory parameter. The value is output header parameter Set-Cookie value of the previous service.

Output

Output Parameters

responseCode

description

Please refer responseCode.

policies

This comes as output for policytype query. It is an array of policy types existing in EMM. Refer policytype examples for more detail.

policyInstances

This comes as output for policy query or devicepolicy query. It is an array of policies existing in EMM. Refer policy or devicepolicy examples for more detail.

Output Headers

Set-Cookie

This helps in maintaining session and passed in consecutive services as value of input header parameter Cookie

Examples

policytype

Input:

query=policytype&deviceid=fbf43e35aeb2fb9eaedf0dddf26250d4

Output:

{
   "description":"success",
   "responseCode":1000,
   "policies":[
      {
         "id":1,
         "name":"PASSCODE_POLICY",
         "desc":"Passcode Policy"
      },
      {
         "id":2,
         "name":"DEVICE_RESTRICTIONS",
         "desc":"Device restrictions"
      },
      {
         "id":3,
         "name":"EMAIL_CALENDAR",
         "desc":"Email and Calendar setup"
      },
      {
         "id":4,
         "name":"NETWORK",
         "desc":"Network"
      },
      {
         "id":5,
         "name":"CERTIFICATE_DISTRIBUTION",
         "desc":"Certificate distribution"
      },
      {
         "id":6,
         "name":"WEB_CLIPS",
         "desc":"Webclips"
      },
      {
         "id":8,
         "name":"COMPLAINCE_ACTIONS",
         "desc":"Compliance Actions"
      },
      {
         "id":9,
         "name":"TRACKING_SETTINGS",
         "desc":"Tracking Settings"
      },
      {
         "id":11,
         "name":"MANDATORY_APPS",
         "desc":"App Policy"
      }
   ]
}

Input2

You can use queryexpression for the policytype queries.

query=policytype&deviceid=fbf43e35aeb2fb9eaedf0dddf26250d4&queryexpression=name=="PASSCODE_POLICY"

Output2

{
   "description":"success",
   "responseCode":1000,
   "policies":[
      {
         "id":1,
         "name":"PASSCODE_POLICY",
         "desc":"Passcode Policy"
      }
   ]
}

policy

Input1

You can use queryexpression for the policy queries.

query=policy&deviceid=fbf43e35aeb2fb9eaedf0dddf26250d4

Output1

{
   "description":"success",
   "responseCode":1000,
   "policyInstances":[
      {
         "policyID":"7502395553198640881",
         "id":1,
         "name":"Name",
         "desc":"",
         "state":"ACTIVE",
         "status":"PUBLISHED",
         "syncID":null,
         "creatorID":"admin",
         "createdTimestamp":"YYYY-MM-DD HH:MM:SS.SS",
         "priority":1,
	  "updatorID":"admin",
         "updatedTimestamp":"YYYY-MM-DD HH:MM:SS.SS",
         "publishTimestamp":"YYYY-MM-DD HH:MM:SS.SS"

         "policyDescription":[
            {
               "constraintKey":"ALLOW_SIMPLE_PASSCODE",
               "constraintName":"Allow Simple Passcode",
               "constraintValue":"true"
            },
            
         ],
         
      },
      

[[-- optional element --]]

Input 2:

You can use queryexpression for the policy queries.

query=policy&deviceid=fbf43e35aeb2fb9eaedf0dddf26250d4&queryexpression=policyID==7502395553198640881

Output 2:

{
   "description":"success",
   "responseCode":1000,
   "policyInstances":[
      {
         "policyID":"7502395553198640881",
         "id":1,
         "name":"Name",
         "desc":"",
         "state":"ACTIVE",
         "status":"PUBLISHED",
         "syncID":null,
         "creatorID":"admin",
         "createdTimestamp":"YYYY-MM-DD HH:MM:SS.SS",
         "priority":1,
         "policyDescription":[
            {
               "constraintKey":"ALLOW_SIMPLE_PASSCODE",
               "constraintName":"Allow Simple Passcode",
               "constraintValue":"true"
            },
            {
               "constraintKey":"REQUIRE_ALPHANUMERIC",
               "constraintName":"Require Alphanumeric",
               "constraintValue":"false"
            },
            {
               "constraintKey":"MIN_PASSODE_LENGTH",
               "constraintName":"Minimum Passcode Length",
               "constraintValue":"4"
            },
            {
               "constraintKey":"NUM_OF_SPECIAL_CHARS",
               "constraintName":"Number of Special characters",
               "constraintValue":"0"
            },
            {
               "constraintKey":"PASSCODE_EXPIRATION",
               "constraintName":"Passcode Expiration",
               "constraintValue":"30"
            },
            {
               "constraintKey":"AUTO_LOCK_TIME_LIMIT",
               "constraintName":"Auto-lock Time Limit",
               "constraintValue":"2"
            },
            {
               "constraintKey":"UNIQUE_PASSCODES_BEFORE_REUSE",
               "constraintName":"Unique Passcodes required Before Reuse",
               "constraintValue":"6"
            },
            {
               "constraintKey":"ERASE_DATA_FAILED_ATTEMPTS",
               "constraintName":"Erase All Data",
               "constraintValue":"9"
            },
            {
               "constraintKey":"IOS_REQUIRE_PASSCODE",
               "constraintName":"Require Passcode",
               "constraintValue":"true"
            }
         ],
         "updatorID":"admin",
         "updatedTimestamp":"YYYY-MM-DD HH:MM:SS.SS",
         "publishTimestamp":"YYYY-MM-DD HH:MM:SS.SS"
      }
   ]
}

Input3

You can use queryexpression for the policy queries. Queiryexpressions can be made complex using Boolean operators:

deviceid=358918050081901&query=policy&queryexpression=name=='P2'||name=='P3'%26%26state=='ACTIVE'&&status=='PUBLISHED'

Output

 {
       "description": "Success",
       "responseCode": 1000,
       "policyInstances":
       [
           {
               "name": "P2",
		"policyID": "7560377597073303607",
		"priority": 2,
               "id": 1,
               "desc": "this is test passcode policy",
               "state": "ACTIVE",
               "status": "PUBLISHED",
               "syncID": null,
               "creatorID": null,
			   "updatorID": null,
               "createdTimestamp": "YYYY-MM-DD HH:MM:SS.SS",
               "updatedTimestamp": "YYYY-MM-DD HH:MM:SS.SS",
               "publishTimestamp": "YYYY-MM-DD HH:MM:SS.SS"
               "policyDescription":
               [
                   {
                       "constraintKey": "AND_REQUIRE_PASSCODE",
                       "constraintName": "Require Passcode",
                       "constraintValue": "false"
                   }
               ],
           }
       ]
    }

devicepolicy

The devicepolicy method queries policies that are acknowleged by a device.

Input

query=devicepolicy&deviceid=fbf43e35aeb2fb9eaedf0dddf26250d4

Output

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <policyInstance>
       <description>Success</description>
       <responseCode>1000</responseCode>
       <policyInstances>
       <createdTimestamp>YYYY-MM-DD HH:MM:SS.SS</createdTimestamp>
                   <desc>
                   </desc>
                   <id>2</id>
                   <name>safe_dr</name>
       <policyDescription>
                   <constraintKey>AND_ALLOW_CAMERA</constraintKey>
                   <constraintName>Challenge Code</constraintName>                                           <constraintValue>false</constraintValue>
       </policyDescription>
                                
                                
       <policyDescription>
             <constraintKey>ANDROID_SAMSUNG_SAFE_EMAIL_ALLOWACCOUNTADDITION</constraintKey>
              <constraintName>Allow Voice Dialer</constraintName>
                                                <constraintValue>true</constraintValue>
        </policyDescription>
         <policyID>7548037160583064994</policyID>
         <priority>3</priority>
         <publishTimestamp>YYYY-MM-DD HH:MM:SS.SS</publishTimestamp>
         <state>ACTIVE</state>
         <status>PUBLISHED</status>
         <updatedTimestamp>YYYY-MM-DD HH:MM:SS.SS</updatedTimestamp>
        </policyInstances>
    </policyInstance>
Copyright © 2018 Kony, Inc. All rights reserved.