Geofencing

Attribute

compliance_id
string
Profile ID of compliance profile which has been modified
collection_id
string
Collection id of the compliance
compliance_status
integer
Status of the compliance
compliance_name
string
Name of the compliance profile
platform_type
string
Type of platform
created_by
integer
Id of the user who created the rule criteria
created_by_name
string
Name of the user who created the rule criteria
creation_time
long
Time of creation of rule criteria in milliseconds
last_modified_by
integer
User who last modified the rule criteria
last_modified_by_name
string
Name of the user who last modified the rule criteria.
last_modified_time
long
Time of last modification in milliseconds
total_count
integer
Total count
yet_to_evaluate_count
integer
Yet to evaluate count
compliant_devices_count
integer
Count of compliant devices
non_compliant_devices_count
integer
Count of non compliant devices
not_applicable_count
integer
Not applicable count
notification_sent_count
integer
Count of notifications sent

Example

[ { "compliance_id": 350, "collection_id": 650, "compliance_status": 110, "compliance_name": "ComplianceUpdated0.8934500788002706", "platform_type": 5, "created_by": 1, "created_by_name": "admin", "creation_time": 1542869208225, "last_modified_by": 1, "last_modified_by_name": "admin", "last_modified_time": 1542869208225, "total_count": 10, "yet_to_evaluate_count": 8, "compliant_devices_count": 0, "non_compliant_devices_count": 1, "not_applicable_count": 1, "notification_sent_count": 1 } ]

Get Fence Policies

Get the list of all fence profiles available
oauthscope : MDMOnDemand.MDMInventory.READ

GET - /api/v1/mdm/compliance

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/api/v1/mdm/compliance", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request GET \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 200 OK
{ "compliance_policies": [ { "compliance_id": 350, "collection_id": 650, "compliance_status": 110, "compliance_name": "ComplianceUpdated0.8934500788002706", "platform_type": 5, "created_by": 1, "created_by_name": "admin", "creation_time": 1542869208225, "last_modified_by": 1, "last_modified_by_name": "admin", "last_modified_time": 1542869208225, "total_count": 10, "yet_to_evaluate_count": 8, "compliant_devices_count": 0, "non_compliant_devices_count": 1, "not_applicable_count": 1, "notification_sent_count": 1 } ] }

Add Fence Policy

Add a Fence profile
oauthscope : MDMOnDemand.MDMInventory.CREATE

POST - /api/v1/mdm/compliance

Arguments

policies
array
(Required)
Collection of details of rules and actions
Show Sub-Attributes arrow
rule
object
Common details of rule
Show Sub-Attributes arrow
rule_name
string
Name of the rule
rule_criterions
array
Collection of criteria which determine rule satisfaction/violation.
Show Sub-Attributes arrow
rule_criteria_type
integer
Rule type
geo_fence_id
integer
Fence id of geofence
rule_criteria_state
integer
State to determine satisfaction/violation of rule
evaluation_order
integer
Order for evaluating the compliance rules
rule_id
integer
Rule ID of the policy
action
object
Common details of action
Show Sub-Attributes arrow
action_attributes
array
Collection of actions to be performed on rule satisfaction/violation.
Show Sub-Attributes arrow
execution_order
integer
Order of execution of action
time_to_execution
integer
Time delay to execute action
action_attribute_type
integer
Type of action
phone_number
long
Phone number to be displayed on lost device
lock_message
string
Message to be shown on lost device
unlock_pin
boolean
Unlock pin to be set for lost device
is_remote_alarm
boolean
Specify whether remote alarm should be initiated on the device in Lost Mode
is_mark_as_non_compliant
boolean
Flag to enable/disable mark as non compliant action
alert_email_ids
array
Array of alert email ids
Show Sub-Attributes arrow
email
string
Email ID
user_name
string
Name of the user
subject
string
Subject of the action attribute
body_message
string
Reason for performing the action
description
string
(Required)
Short description of compliance profile
compliance_name
string
(Required)
Name of the compliance profile

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/v1/mdm/compliance", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance") .post(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request POST \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "policies": [ { "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "action": { "action_attributes": [ { "execution_order": 1, "time_to_execution": 0, "action_attribute_type": 1, "phone_number": 0, "lock_message": "Device is lost", "unlock_pin": "01928374", "is_remote_alarm": false, "is_mark_as_non_compliant": true, "alert_email_ids": [ { "email": "admin@zylker.com", "user_name": "admin" } ], "subject": "Warning", "body_message": "The device is outside its permitted fence." } ] } } ], "description": "Compliance Profile", "compliance_name": "ComplianceUpdated0.8934500788002706" }

Response Example

HTTP/1.1 200 OK
{ "policies": [ { "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "action": { "action_attributes": [ { "execution_order": 1, "time_to_execution": 0, "action_attribute_type": 1, "phone_number": 0, "lock_message": "Device is lost", "unlock_pin": "01928374", "is_remote_alarm": false, "is_mark_as_non_compliant": true, "alert_email_ids": [ { "email": "admin@zylker.com", "user_name": "admin" } ], "subject": "Warning", "body_message": "The device is outside its permitted fence." } ] } } ], "description": "Compliance Profile", "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "compliance_name": "ComplianceUpdated0.8934500788002706", "collection_id": 650, "is_moved_to_trash": false, "compliance_id": 350 }

Delete Multiple Fence Policy

Delete multiple Fence Policy
oauthscope : MDMOnDemand.MDMInventory.DELETE

DELETE - /api/v1/mdm/compliance

Arguments

compliance_ids
array
(Required)
Collection of compliance IDs for compliance rules to be deleted

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("DELETE", "/api/v1/mdm/compliance", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance") .delete(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request DELETE \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "compliance_ids": [ "1", "2", "3" ] }

Response Example

HTTP/1.1 204 No Content

Get Fence Policy Details

Gets a specific Fence profile
oauthscope : MDMOnDemand.MDMInventory.READ

GET - /api/v1/mdm/compliance/{compliance_id}

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/api/v1/mdm/compliance/350", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance/350") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request GET \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance/350 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 200 OK
{ "policies": [ { "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "action": { "action_attributes": [ { "execution_order": 1, "time_to_execution": 0, "action_attribute_type": 1, "phone_number": 0, "lock_message": "Device is lost", "unlock_pin": "01928374", "is_remote_alarm": false, "is_mark_as_non_compliant": true, "alert_email_ids": [ { "email": "admin@zylker.com", "user_name": "admin" } ], "subject": "Warning", "body_message": "The device is outside its permitted fence." } ] } } ], "description": "Compliance Profile", "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "compliance_name": "ComplianceUpdated0.8934500788002706", "collection_id": 650, "is_moved_to_trash": false, "compliance_id": 350 }

Modify Fence Policy

Modifies specified Fence profile
oauthscope : MDMOnDemand.MDMInventory.CREATE

PUT - /api/v1/mdm/compliance/{compliance_id}

Arguments

policies
array
(Required)
Collection of details of rules and actions
Show Sub-Attributes arrow
rule
object
Common details of rule
Show Sub-Attributes arrow
rule_name
string
Name of the rule
rule_criterions
array
Collection of criteria which determine rule satisfaction/violation.
Show Sub-Attributes arrow
rule_criteria_type
integer
Rule type
geo_fence_id
integer
Fence id of geofence
rule_criteria_state
integer
State to determine satisfaction/violation of rule
evaluation_order
integer
Order for evaluating the compliance rules
rule_id
integer
Rule ID of the policy
action
object
Common details of action
Show Sub-Attributes arrow
action_attributes
array
Collection of actions to be performed on rule satisfaction/violation.
Show Sub-Attributes arrow
execution_order
integer
Order of execution of action
time_to_execution
integer
Time delay to execute action
action_attribute_type
integer
Type of action
phone_number
long
Phone number to be displayed on lost device
lock_message
string
Message to be shown on lost device
unlock_pin
boolean
Unlock pin to be set for lost device
is_remote_alarm
boolean
Specify whether remote alarm should be initiated on the device in Lost Mode
is_mark_as_non_compliant
boolean
Flag to enable/disable mark as non compliant action
alert_email_ids
array
Array of alert email ids
Show Sub-Attributes arrow
email
string
Email ID
user_name
string
Name of the user
subject
string
Subject of the action attribute
body_message
string
Reason for performing the action
description
string
(Required)
Short description of compliance profile
compliance_name
string
(Required)
Name of the compliance profile

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("PUT", "/api/v1/mdm/compliance/350", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance/350") .put(body) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
curl --request PUT \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance/350 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "policies": [ { "rule": { "rule_name": "Tower", "rule_criterions": [ { "rule_criteria_type": 2, "geo_fence_id": 1, "rule_criteria_state": 2 } ], "evaluation_order": 1, "rule_id": 412 }, "action": { "action_attributes": [ { "execution_order": 1, "time_to_execution": 0, "action_attribute_type": 1, "phone_number": 0, "lock_message": "Device is lost", "unlock_pin": "01928374", "is_remote_alarm": false, "is_mark_as_non_compliant": true, "alert_email_ids": [ { "email": "admin@zylker.com", "user_name": "admin" } ], "subject": "Warning", "body_message": "The device is outside its permitted fence." } ] } } ], "description": "Compliance Profile", "compliance_name": "ComplianceUpdated0.8934500788002706" }

Response Example

HTTP/1.1 200 OK
{ "collection_id": 650, "user_id": 1, "compliance_file_name_path": ".. webapps DesktopCentral client-data 1 mdm compliance 650 compliance_profile.json", "remove_compliance_file_name_path": ".. webapps DesktopCentral client-data 1 mdm compliance 650 remove_compliance_profile.json", "customer_id": 1, "compliance_id": 350, "compliance_name": "ComplianceUpdated0.8934500788002706" }

Delete Fence Policy

Delete a Fence profile
oauthscope : MDMOnDemand.MDMInventory.DELETE

DELETE - /api/v1/mdm/compliance/{compliance_id}

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.com") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("DELETE", "/api/v1/mdm/compliance/350", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.mdm.manageengine.com/api/v1/mdm/compliance/350") .delete(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request DELETE \ --url https://www.mdm.manageengine.com/api/v1/mdm/compliance/350 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 204 No Content