Fence Policy

Fence Policy

Fence Policy

End Points
Get Groups For Fence Policy
Associate Fence Policy To Multiple Group
Dis-Associate Fence Policy From Multiple Group

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 groups 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
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.mdm.manageengine.in/api/v1/mdm/compliance/382798473/groups") .get() .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.in") 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"))
curl --request GET \ --url https://www.mdm.manageengine.in/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
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.in/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();
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.in") 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"))
curl --request POST \ --url https://www.mdm.manageengine.in/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
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.mdm.manageengine.in/api/v1/mdm/compliance/382798473/groups") .delete(null) .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
import http.client conn = http.client.HTTPSConnection("www.mdm.manageengine.in") 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"))
curl --request DELETE \ --url https://www.mdm.manageengine.in/api/v1/mdm/compliance/382798473/groups \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

HTTP/1.1 204 No Content