Fence Policy

Fence Policy

Fence Policy

Attribute

group_id
long
Unique identifier of the group
group_name
string
Name of the group
group_type
integer
Type of the group
member_count
integer
Count of members in the group

Example

[ { "group_id": 302, "group_name": "ComplianceGroup", "group_type": 6, "member_count": 1 } ]

Get Groups For Fence Policy

Get the list of group to which the Fence policy is associated and the current Fence status of the group
oauthscope : MDMOnDemand.MDMInventory.READ

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

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/api/v1/mdm/compliance/382798473/groups", 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.eu/api/v1/mdm/compliance/382798473/groups") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request GET \ --url https://www.mdm.manageengine.eu/api/v1/mdm/compliance/382798473/groups \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 200 OK
{ "group_list": [ { "group_id": 302, "group_name": "ComplianceGroup", "group_type": 6, "member_count": 1 } ], "compliance_id": 382798473 }

Associate Fence Policy To Multiple Group

Fence to device groups distribution
oauthscope : MDMOnDemand.MDMInventory.CREATE

POST - /api/v1/mdm/compliance/{compliance_id}/groups

Arguments

id
string
Profile ID of compliance profile
group_ids
array
(Required)
Collection of group IDs from which compliance needs to be removed

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/v1/mdm/compliance/382798473/groups", 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.eu/api/v1/mdm/compliance/382798473/groups") .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.eu/api/v1/mdm/compliance/382798473/groups \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "id": 9839823982939, "group_ids": [ "1", "2", "3" ] }

Response Example

HTTP/1.1 204 No Content

Dis-Associate Fence Policy From Multiple Group

Disassociate Fence rule from a group of devices
oauthscope : MDMOnDemand.MDMInventory.DELETE

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

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("DELETE", "/api/v1/mdm/compliance/382798473/groups", 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.eu/api/v1/mdm/compliance/382798473/groups") .delete(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request DELETE \ --url https://www.mdm.manageengine.eu/api/v1/mdm/compliance/382798473/groups \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 204 No Content

Get devices under Group for Fence Policy

Get the list of groups to which the Fence policy is associated and the current compliance status of the group

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

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/api/v1/mdm/compliance/382798473/groups/302", 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.eu/api/v1/mdm/compliance/382798473/groups/302") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request GET \ --url https://www.mdm.manageengine.eu/api/v1/mdm/compliance/382798473/groups/302 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 200 OK
{ "group_id": 302, "group_name": "ComplianceGroup", "devices": [ { "device_id": 1920403, "device_name": "Samsung S9", "device_platform": 2, "device_compliance_state": "compliant", "compliance_score": 100 } ], "group_compliance_state": "non_compliant", "compliance_id": 382798473, "compliance_name": "COMPLIANCE 1" }

Associate Fence Policy To Group

Associate Fence rule to a group of devices
oauthscope : MDMOnDemand.MDMInventory.CREATE

POST - /api/v1/mdm/compliance/{compliance_id}/groups/{group_id}

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/api/v1/mdm/compliance/382798473/groups/302", 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.eu/api/v1/mdm/compliance/382798473/groups/302") .post(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request POST \ --url https://www.mdm.manageengine.eu/api/v1/mdm/compliance/382798473/groups/302 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 204 No Content

Dis-Associate Fence Policy From Group

Fence remove from device group
oauthscope : MDMOnDemand.MDMInventory.DELETE

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

Request Example

Click to copy
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.eu") headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("DELETE", "/api/v1/mdm/compliance/382798473/groups/302", 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.eu/api/v1/mdm/compliance/382798473/groups/302") .delete(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
curl --request DELETE \ --url https://www.mdm.manageengine.eu/api/v1/mdm/compliance/382798473/groups/302 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 204 No Content