Updating a Policy
Description | If you wish to make changes to an existing policy, you can do so by updating the policy using the REST API command given below. | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /{id} | ||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/{id} | ||||||||||||||||||||||||||||||
HTTP Method | PUT | ||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||
cURL command | curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -d @'<JSON_PAYLOAD>'-k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/{id}
Example: Update the policy having the policy ID curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/1 | ||||||||||||||||||||||||||||||
 Sample output | > PUT /mdm-admin/policies/1 HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 571 < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Thu, 25 Feb 2016 11:29:30 GMT < Content-Type: application/json < Content-Length: 78 < Server: WSO2 Carbon Server {"messageFromServer":"Policy has been updated successfully."} | ||||||||||||||||||||||||||||||
Sample JSON Definition | { "policyName":"Camera", "description":"Optional", "compliance":"enforce", "ownershipType":"ANY", "profile":{ "profileName":"Camera", "deviceType":{ "id":1 }, "profileFeaturesList":[ { "featureCode":"CAMERA", "deviceTypeId":1, "content":{ "enabled":true } }, { "featureCode":"ENCRYPT_STORAGE", "deviceTypeId":1, "content":{ "encrypted":true } } ] }, "roles":["ANY"] }
|