End User License Agreement profiles (API)
EULA parameters
Use these parameters in the JSON data structure when you apply the EULA policy (POLICY_CODE_END_USER_LICENSE_AGREEMENT) to the app with app-market/policy.
locale_language-region | A text file for the specified locale (UTF-8 to handle non-ASCII characters). A profile can have as many locales as needed, but only one file per locale. You must configure at least one valid file and locale. |
maxAgeMonths | Number of months the EULA is valid. (A "month" is 30 days.) Once this expires, the user must accept the EULA again. 1 means once a month, 12 means once a year. If this parameter is supplied, its value must be a string number between 0–12. |
maxAgeDays | Number of days the EULA is valid. Once this expires, the user must accept the EULA again. If this parameter is supplied, its value must be a string number between 0–31. |
Note: If this policy profile is applied to an app and both maxAgeMonths and maxAgeDays are omitted or both are set to 0, users must accept the agreement only the first time they launch the app or group of apps.
EULA API resources
To manage EULA profiles:
- profile : Use type="end_user_license_agreement" to create a EULA profile. See example below.
- profile/catalog/{policytype} : Use "end_user_license_agreement" for "{type}". GET returns an array of details for all policy profiles of the specified type.
- profile/{GUID} : Use the profile ID to specify a policy profile. GET returns details for the specified profile, PUT updates the details in the specified profile, and DELETE archives the profile.
- settings/end_user_license_agreement-default-profile (settings/{policytype}-default-profile : POST sets one of the EULA profiles as the default. GET returns the GUID of the current default profile. DELETE archives the current default.
To retrieve details for the policy:
- app-policy/{GUID}: Use the policy ID to specify a policy. GET returns details for the specified policy.
- app-policy/code/{code}: Use POLICY_CODE_END_USER_LICENSE_AGREEMENT to specify the policy. GET returns details for the specified policy.
To secure apps with Device Posture policy:
- app-market/policy: Use the policy GUID to apply the policy to an app.
Creating a EULA profile
This example creates a EULA profile with the profile API, specifying all options.
Request
curl -k -v -L -b c.txt -c c.txt -X POST http://bc.qwe.com:8080/mocana-app-control/rest/profile \
-F name="TestProfile" \
-F type="end_user_license_agreement" \
-F desc="TestProfile" \
-F data="{\"maxAgeMonths\":\"3\", \"maxAgeDays\": \"15\"}" \
-F locale_en-US=@license-english.txt \
-F locale_sv-SE=@license-swedish.txt
Response
{"message": "",
"profiles": {
"data": {
"profile_data": "{\"maxAgeDays\":\"15\",
\"locale_sv-SEBlobId\":\"bf7bb21f-2833-43ff-8e09-94d314841964\",
\"maxAgeMonths\":\"3\",
\"locale_en-USBlobId\":\"f4b5c22c-e8dc-4cde-93ae-5eb81368e3a5\"}",
"profile_data_id": "e9e2c333-44bf-40b7-b70d-456f0190444e",
"profile_data_stamp": "2017-08-14 12:09:16.0"
},
"profile_desc": "Default Profile",
"profile_id": "e887be06-2918-4c27-b389-8334555d626d",
"profile_name": "TestProfile",
"profile_type": "end_user_license_agreement",
"profile_url": "http://bc.qwe.com/mocana-app-control/rest/profile/e887be06-2918-4c27-b389-8397555d626d"
},
"status": "OK"
}