Policy Functions via the Console
This section provides the details of the REST APIs used to carry out functions related to policies via the EMM console:
Adding a policy via the console
Description | Add a policy using this REST API command. When adding a policy you will have the option of saving the policy or saving and publishing the policy. Using the REST API command given below you are able to save a created Policy and this policy will be in the inactive state.
| ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /inactive-policy | ||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/inactive-policy
| ||||||||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||
cURL command | curl -X POST -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/inactive-policy
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/inactive-policy | ||||||||||||||||||||||||||||||
Sample output | > POST /mdm-admin/policies/inactive-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 420 < HTTP/1.1 201 Created < Date: Thu, 25 Feb 2016 06:30:18 GMT < Content-Type: application/json < Content-Length: 76 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"Policy has been added 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 } } ] }, "users":[], "roles":[] }
If you wish to add a new policy criteria than what is already supported (users and roles) you can do so by defining a new policy criteria within the " |
Adding an active policy
Description | Add a policy that is in the active state using the REST API command. When adding a policy you will have the option of saving the policy or saving and publishing the policy. Using the REST API command given below you are able to save and publish a created policy and this policy will be in the active state.
| ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /active-policy | ||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/active-policy | ||||||||||||||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||
cURL command | curl -X POST -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/active-policy
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/active-policy | ||||||||||||||||||||||||||||||
Sample output | > POST /mdm-admin/policies/active-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 326a1824316a122152570d2dfd137ee7 > Content-Length: 420 < HTTP/1.1 201 OK < Date: Thu, 25 Feb 2016 08:26:09 GMT < Content-Type: application/json < Content-Length: 76 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"Policy has been added 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 } } ] }, "users":[], "roles":[] }
If you wish to add a new policy criteria than what is already supported (users and roles) you can do so by defining a new policy criteria within the " |
Getting details of policies
Description | Retrieve the details of all the policies that you have created in WSO2 EMM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | / | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > GET /mdm-admin/policies/ HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Thu, 25 Feb 2016 08:29:09 GMT < Content-Type: application/json < Content-Length: 1205 < Server: WSO2 Carbon Server {"id":1,"priorityId":1,"profile":{"profileId":1,"profileName":"Camera","tenantId":-1234,"deviceType":{"id":1,"name":"android"},"createdDate":"Feb 25, 2016 12:00:18 PM","updatedDate":"Feb 25, 2016 12:00:18 PM","profileFeaturesList":[{"id":1,"featureCode":"CAMERA","profileId":1,"deviceTypeId":1,"content":"{\"enabled\":true}"}]},"policyName":"Camera","generic":false,"roles":[],"ownershipType":"ANY","devices":[],"users":[],"active":false,"updated":false,"description":"Optional","compliance":"enforce","policyCriterias":[],"tenantId":-1234,"profileId":1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON Definition | { "id":1, "priorityId":1, "profile":{ "profileId":1, "profileName":"Camera", "tenantId":-1234, "deviceType":{ "id":1, "name":"android" }, "createdDate":"Feb 25, 2016 12:00:18 PM", "updatedDate":"Feb 25, 2016 12:00:18 PM", "profileFeaturesList":[ { "id":1, "featureCode":"CAMERA", "profileId":1, "deviceTypeId":1, "content":"{\"enabled\":true}" } ] }, "policyName":"Camera", "generic":false, "roles":[], "ownershipType":"ANY", "devices":[], "users":[], "active":true, "updated":true, "description":"Optional", "compliance":"enforce", "policyCriterias":[], "tenantId":-1234, "profileId":1 }
|
Getting details of a policy
Description | Retrieve the details of a selected policy in WSO2 EMM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /{id} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/{id} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/{id}
Example: Retrieve the policy details of the policy having the ID curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > GET /mdm-admin/policies/1 HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Thu, 25 Feb 2016 09:53:45 GMT < Content-Type: application/json < Content-Length: 652 < Server: WSO2 Carbon Server {"id":1,"priorityId":1,"profile":{"profileId":1,"profileName":"Camera","tenantId":-1234,"deviceType":{"id":1,"name":"android"},"createdDate":"Feb 25, 2016 12:00:18 PM","updatedDate":"Feb 25, 2016 12:00:18 PM","profileFeaturesList":[{"id":1,"featureCode":"CAMERA","profileId":1,"deviceTypeId":1,"content":"{\"enabled\":true}"}]},"policyName":"Camera","generic":false,"roles":[],"ownershipType":"ANY","devices":[],"users":[],"active":false,"updated":false,"description":"Optional","compliance":"enforce","policyCriterias":[],"tenantId":-1234,"profileId":1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON Definition | { "id":1, "priorityId":1, "profile":{ "profileId":1, "profileName":"Camera", "tenantId":-1234, "deviceType":{ "id":1, "name":"android" }, "createdDate":"Feb 25, 2016 12:00:18 PM", "updatedDate":"Feb 25, 2016 12:00:18 PM", "profileFeaturesList":[ { "id":1, "featureCode":"CAMERA", "profileId":1, "deviceTypeId":1, "content":"{\"enabled\":true}" } ] }, "policyName":"Camera", "generic":false, "roles":[ ], "ownershipType":"ANY", "devices":[], "users":[], "active":false, "updated":false, "description":"Optional", "compliance":"enforce", "policyCriterias":[], "tenantId":-1234, "profileId":1 }
|
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"] }
|
Updating the policy priority
Description | If you wish to make changes to the existing policy priority order, you can do so by updating the priority order using the REST API command given below. | ||||||
---|---|---|---|---|---|---|---|
Resource Path | /priorities | ||||||
URL | /mdm-admin/policies/priorities | ||||||
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/priorities
Example: curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/priorities | ||||||
Sample output | > PUT /mdm-admin/policies/priorities HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 23 < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Thu, 25 Feb 2016 13:01:57 GMT < Content-Type: application/json < Content-Length: 80 < Server: WSO2 Carbon Server {"statusCode":200",messageFromServer":"Policy Priorities successfully updated."} | ||||||
Sample JSON Definition | [ { "id":2, "priority":1 } ]
|
Removing multiple policies
Description | In situations where you need to delete more than one policy you can do so using the REST API command given below. |
---|---|
Resource Path | /bulk-remove |
URL | /mdm-admin/policies/bulk-remove |
HTTP Method | POST |
Request/Response Format | application/json |
cURL command | curl -X POST -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/bulk-remove
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/bulk-remove |
Sample output | > POST /mdm-admin/policies/bulk-remove HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 23 < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 06:35:00 IST < Date: Thu, 25 Feb 2016 14:06:57 GMT < Content-Type: application/json < Content-Length: 80 < Server: WSO2 Carbon Server {"statusCode":200",messageFromServer":"Policies have been successfully deleted."} |
Sample JSON Definition | [1,2] Define the IDs of the policies you wish to delete. If you are unsure of the policy IDs run the REST API command to retrieve all the policy details in WSO2 EMM. |
Activating policies
Description | Using the REST API command you are able to publish a policy in order to bring a policy that is in the inactive state to the active state. |
---|---|
Resource Path | /activate |
URL | /mdm-admin/policies/activate |
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/activate
Example: curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/activate |
Sample output | > PUT /mdm-admin/policies/activate HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 23 < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 06:35:00 IST < Date: Thu, 25 Feb 2016 14:06:57 GMT < Content-Type: application/json < Content-Length: 80 < Server: WSO2 Carbon Server {"statusCode":200","messageFromServer": "Selected policies have been successfully activated."} |
Sample JSON Definition | [{1,2}] Define the ID/IDs of the policies you wish to publish. If you are unsure of the policy IDs run the REST API command to retrieve all the policy details in WSO2 EMM. |
Deactivating policies
Description | Using the REST API command you are able to unpublish a policy in order to bring a policy that is in the active state to the inactive state. |
---|---|
Resource Path | /inactivate |
URL | /mdm-admin/policies/inactivate |
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/inactivate
Example: curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/inactivate |
Sample output | > PUT /mdm-admin/policies/inactivate HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 23 < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 06:35:00 IST < Date: Thu, 25 Feb 2016 14:06:57 GMT < Content-Type: application/json < Content-Length: 80 < Server: WSO2 Carbon Server {"statusCode":200","messageFromServer": "Selected policies have been successfully inactivated."} |
Sample JSON Definition | [{1,2}] Define the ID/IDs of the policies you wish to unpublish. If you are unsure of the policy IDs run the REST API command to retrieve all the policy details in WSO2 EMM. |
Applying changes on policies
Description | Policies in the active state will be applied to new device that register with WSO2 EMM based on the policy enforcement criteria . In a situation where you need to make changes to existing policies (removing, activating, deactivating and updating) or add new policies, the existing devices will not receive these changes immediately. Once all the required changes are made you need to apply the changes to push the policy changes to the existing devices. |
---|---|
Resource Path | /apply-changes |
URL | /mdm-admin/policies/apply-changes |
HTTP Method | PUT |
Request/Response Format | application/json |
cURL command | curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/apply-changes
Example: curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/apply-changes |
Sample output | > PUT /mdm-admin/policies/apply-changes HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Fri, 26 Feb 2016 11:35:02 GMT < Content-Type: application/json < Content-Length: 80 < Server: WSO2 Carbon Server {"statusCode":200,"messageFromServer":"Changes have been successfully updated."} |
Starting policy monitoring
Description | WSO2 EMM monitors the devices to identify any devices that have not complied to an enforced policy. The policy monitoring task begins at the point WSO2 EMM has a a published policy. It will monitor the device based on the policy monitoring frequency that you define in milliseconds. Using this REST API to start the policy monitoring task is optional as WSO2 EMM uses an OSGI call to start the monitoring task. |
---|---|
Resource Path | /start-task/{milliseconds} |
URL | /mdm-admin/policies/start-task/{milliseconds} |
HTTP Method | GET |
Request/Response Format | application/json |
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/start-task/{milliseconds}
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/start-task/6000 |
Sample output | > GET /mdm-admin/policies/start-task/600 HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Fri, 26 Feb 2016 11:50:37 GMT < Content-Type: application/json < Content-Length: 88 < Server: WSO2 Carbon Server {"statusCode":200,"messageFromServer":"Policy monitoring service started successfully."} |
Updating policy monitoring
Description | WSO2 EMM monitors the devices to identify any devices that have not complied to an enforced policy. If you wish to update the policy monitoring frequency you can do so using the following REST API command. |
---|---|
Resource Path | /update-task/{milliseconds} |
URL | /mdm-admin/policies/update-task/{milliseconds} |
HTTP Method | GET |
Request/Response Format | application/json |
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/update-task/{milliseconds}
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/update-task/6500 |
Sample output | > GET /mdm-admin/policies/update-task/6500 HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Sat, 27 Feb 2016 07:23:15 GMT < Content-Type: application/json < Content-Length: 88 < Server: WSO2 Carbon Server {"statusCode":200,"messageFromServer":"Policy monitoring service updated successfully."} |
Stopping policy monitoring
Description | WSO2 EMM monitors the devices to identify any devices that have not complied to an enforced policy. The policy monitoring task begins at the point WSO2 EMM has a a published policy. If you wish to stop the policy monitoring task you can do so by using the REST API command given below. |
---|---|
Resource Path | /stop-task |
URL | /mdm-admin/policies/stop-task |
HTTP Method | GET |
Request/Response Format | application/json |
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/stop-task
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/stop-task |
Sample output | > GET /mdm-admin/policies/stop-task HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Sat, 27 Feb 2016 07:31:50 GMT < Content-Type: application/json < Content-Length: 88 < Server: WSO2 Carbon Server {"statusCode":200,"messageFromServer":"Policy monitoring service stopped successfully."} |
Getting policy enforced details of a device
Description | When a device registers with WSO2 EMM a policy is enforced on the device. Initially, the EMM filters the policies based on the Platform (device type), filters based on the device ownership type , filters based on the user role or name and finally the policy is enforced on the device. For more information, see Managing Policies. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /{type}/{id}/active-policy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/{type}/{id}/active-policy
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/{type}/{id}/active-policy
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/iso/ee07b9c45904ef3af3tt5r4t13d0d6cd58a4567y/active-policy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > GET /mdm-admin/policies/ios/ee07b9c45904ef3af3tt5r4t13d0d6cd58a4567y/active-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Sat, 27 Feb 2016 08:04:28 GMT < Content-Type: application/json < Content-Length: 797 < Server: WSO2 Carbon Server {"id":38,"priorityId":3,"profile":{"profileId":38,"profileName":"iOS Policies","tenantId":-1234,"deviceType":{"id":33,"name":"ios"},"createdDate":"Feb 27, 2016 1:33:13 PM","updatedDate":"Feb 27, 2016 1:33:13 PM","profileFeaturesList":[{"id":39,"featureCode":"PASSCODE_POLICY","profileId":38,"deviceTypeId":33,"content":"{\"forcePIN\":true,\"allowSimple\":true,\"requireAlphanumeric\":true,\"minLength\":\"10\", \"minComplexChars\":\"3\",\"maxPINAgeInDays\":\"50\",\"pinHistory\":\"25\",\"maxInactivity\":\"3\", \"maxGracePeriod\":\"1\",\"maxFailedAttempts\":\"6\"}"}]},"policyName":"iOS Policies","generic":false, "roles":["ANY"],"ownershipType":"BYOD","devices":[],"users":[],"active":true,"updated":false,"description":"","compliance":"enforce","policyCriterias":[],"tenantId":-1234,"profileId":38} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON output | { "id":38, "priorityId":3, "profile":{ "profileId":38, "profileName":"iOS Policies", "tenantId":-1234, "deviceType":{ "id":33, "name":"ios" }, "createdDate":"Feb 27, 2016 1:33:13 PM", "updatedDate":"Feb 27, 2016 1:33:13 PM", "profileFeaturesList":[ { "id":39, "featureCode":"PASSCODE_POLICY", "profileId":38, "deviceTypeId":33, "content":"{\"forcePIN\":true,\"allowSimple\":true,\"requireAlphanumeric\":true,\"minLength\":\"10\", \"minComplexChars\":\"3\",\"maxPINAgeInDays\":\"50\",\"pinHistory\":\"25\",\"maxInactivity\":\"3\", \"maxGracePeriod\":\"1\",\"maxFailedAttempts\":\"6\"}" } ] }, "policyName":"iOS Policies", "generic":false, "roles":["ANY"], "ownershipType":"BYOD", "devices":[], "users":[], "active":true, "updated":false, "description":"", "compliance":"enforce", "policyCriterias":[], "tenantId":-1234, "profileId":38 }
|
Getting the policy count
Description | Get the number of policies that are created in WSO2 EMM. |
---|---|
Resource Path | /count |
URL | /mdm-admin/policies/count |
HTTP Method | GET |
Request/Response Format | application/json |
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/policies/count
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/policies/count |
Sample output | > GET /mdm-admin/policies/count HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Thu, 25 Feb 2016 10:58:30 GMT < Content-Type: application/json < Content-Length: 1 < Server: WSO2 Carbon Server 10 |
Sample JSON Output Definition | Provides the number of policies in WSO2 EMM at the time of running the REST API command as an integer value. Example: As per the above sample output there are 10 policies in the EMM. |
Adding a user restriction policy
Description | Restrict different functions on the user's device using this REST API. When adding a policy you will have the option of saving the user restriction policy or saving and publishing the user restriction policy. For a better understanding on how this works via the EMM console, see Adding a Policy. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/inactive-policy or /mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | POST | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X POST -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/inactive-policy or curl -X POST -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/active-policy
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/inactive-policy or curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > POST /mdm-admin/policies/inactive-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 420 < HTTP/1.1 201 Created < Date: Thu, 25 Feb 2016 06:30:18 GMT < Content-Type: application/json < Content-Length: 76 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"Policy has been added successfully."} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON Definition | { "policyName": "restriction_policy", "description": "Add restriction on the devices that have the settings application installed.", "compliance": "enforce", "ownershipType": "ANY", "profile": { "profileName": "restriction_policy", "deviceType": { "id": 1 }, "profileFeaturesList": [ { "featureCode": "CAMERA", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_ADJUST_VOLUME", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_BLUETOOTH", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_CELL_BROADCASTS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_CREDENTIALS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_MOBILE_NETWORKS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_TETHERING", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_VPN", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CONFIG_WIFI", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_APPS_CONTROL", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CREATE_WINDOWS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_CROSS_PROFILE_COPY_PASTE", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_DEBUGGING_FEATURES", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_FACTORY_RESET", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_ADD_USER", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_INSTALL_APPS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_INSTALL_UNKNOWN_SOURCES", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_MODIFY_ACCOUNTS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_MOUNT_PHYSICAL_MEDIA", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_NETWORK_RESET", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_OUTGOING_BEAM", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_OUTGOING_CALLS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_REMOVE_USER", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_SAFE_BOOT", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_SHARE_LOCATION", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_SMS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_UNINSTALL_APPS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_UNMUTE_MICROPHONE", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "DISALLOW_USB_FILE_TRANSFER", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "ALLOW_PARENT_PROFILE_APP_LINKING", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "ENSURE_VERIFY_APPS", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "AUTO_TIME", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "SET_SCREEN_CAPTURE_DISABLED", "deviceTypeId": 1, "content": { "enabled": true } }, { "featureCode": "SET_STATUS_BAR_DISABLED", "deviceTypeId": 1, "content": { "enabled": true } } ] }, "roles": [ "ANY" ] }
If you wish to add a new policy criteria than what is already supported (users and roles) you can do so by defining a new policy criteria within the "
|
Property | Description | Available | Data Type |
---|---|---|---|
CAMERA | Define if the user is allowed to use the camera by assigning true as the value. | 4.1.x | Boolean |
| Define if a user is disallowed from adjusting the master volume by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring bluetooth by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring cell broadcasts by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring user credentials by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring mobile networks by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring Tethering & portable hotspots by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from configuring VPN by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from changing Wi-Fi access points by assigning true as the value. | 5.0.0 | Boolean |
| Define that windows besides app windows should not be created by assigning true as the value. | 5.0.0 | Boolean |
| Define if what is copied in the clipboard can be pasted in related profiles by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from enabling or accessing debugging features by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed to factory reset the device from Settings by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from adding new users and profiles by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from installing applications by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from enabling the "Unknown Sources" setting, that allows installation of apps from unknown sources by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from adding and removing accounts, unless they are programmatically added by Authenticator. For more information, see the details on adding an account directly. | 5.0.0 | Boolean |
| Define if a user is disallowed from mounting physical external media by assigning true as the value. | 5.0.0 | Boolean |
| Define if a user is disallowed from resetting network settings from Settings by assigning true as the value. | 5.0.0 | Boolean |
| Define if the user is not allowed to use NFC to beam out data from apps by assigning true as the value. | 5.0.0 | Boolean |
| Define that the user is not allowed to make outgoing phone calls by assigning true as the value. | 5.0.0 | Boolean |
| If the value assigned is true, it defines that the user can not remove other users, When set on the primary user this specifies | 5.0.0 | Boolean |
| Define if the user is not allowed to reboot the device into safe boot mode. | 5.0.0 | Boolean |
| Define if a user is disallowed from turning on location sharing. | 5.0.0 | Boolean |
| Define that the user is not allowed to send or receive SMS messages. | 5.0.0 | Boolean |
| Define if a user is disallowed from uninstalling applications. | 5.0.0 | Boolean |
| Define if a user is disallowed from adjusting microphone volume. | 5.0.0 | Boolean |
| Define if a user is disallowed from transferring files over USB. | 5.0.0 | Boolean |
| Allows apps in the parent profile to handle web links from the managed profile if the value is set to true. | 5.0.0 | Boolean |
| Define if a user is disallowed from disabling application verification. | 5.0.0 | Boolean |
| Defines that the auto time feature in the device that is in Settings > Date & Time is enabled if the value is set to true. | 5.0.0 | Boolean |
| The screen shot option on the device will be disabled if the value is set to true. | 5.0.0 | Boolean |
| The status bar on the device will not be shown if the value is set to true. | 6.0.0 | Boolean |
Whitelisting or blacklisting applications
Description | Whitelist or blacklist applications using this API. In whitelisting you define the applications that a user is allowed to use on the device and in blacklisting you define the applications that a user is not allowed to use on a device. | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path |
| |||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/inactive-policy or /mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | POST | |||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | |||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X POST -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/inactive-policy or curl -X POST -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/active-policy
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/inactive-policy or curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > POST /mdm-admin/policies/active-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 420 < HTTP/1.1 201 Created < Date: Thu, 25 Feb 2016 06:30:18 GMT < Content-Type: application/json < Content-Length: 76 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"Policy has been added successfully."} | |||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON Definition |
If you wish to add a new policy criteria than what is already supported (roles) you can do so by defining a new policy criteria within the " |
Setting up a VPN on Android devices
Description | Set up a VPN on your Android devices remotely. It allows the device to access secured resources on the intranet of an Organization. | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path |
| |||||||||||||||||||||||||||||||||||||||||||||||||||
URL | /mdm-admin/policies/inactive-policy or /mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||
HTTP Method | POST | |||||||||||||||||||||||||||||||||||||||||||||||||||
Request/Response Format | application/json | |||||||||||||||||||||||||||||||||||||||||||||||||||
cURL command | curl -X POST -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/inactive-policy or curl -X POST -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/active-policy
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/inactive-policy or curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'policy.json' -k -v https://localhost:9443/mdm-admin/policies/active-policy | |||||||||||||||||||||||||||||||||||||||||||||||||||
Sample output | > POST /mdm-admin/policies/active-policy HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 420 < HTTP/1.1 201 Created < Date: Thu, 25 Feb 2016 06:30:18 GMT < Content-Type: application/json < Content-Length: 76 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"Policy has been added successfully."} | |||||||||||||||||||||||||||||||||||||||||||||||||||
Sample JSON Definition | { "policyName":"VPN", "description":"", "compliance":"enforce", "ownershipType":"ANY", "profile":{ "profileName":"vpn", "deviceType":{ "id":1 }, "profileFeaturesList":[ { "featureCode":"VPN", "deviceTypeId":1, "content":{ "serverAddress":"abc.com", "serverPort":"1234", "sharedSecret":"wso2", "dnsServer":"1.1.1.1" } } ] }, "roles":[ "ANY" ] }
|