# Add Java rules to a JRM profile Adds URL-based and group-based Java rules to a Draft JRM profile. ## Endpoint `POST /bsp/api/v1/bmp/jrm/{jrm_profile_id}/jrm_payloads` ## Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/bsp/api/v1/bmp/jrm/{jrm_profile_id}/jrm_payloads` ## Scope `DesktopCentralCloud.BrowserManager.CREATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** (string, Mandatory): `application/json` - **Accept** (string, Mandatory): `application/json` ### Path Parameters - **jrm_profile_id** (string, Mandatory): JRM Profile ID from [List JRM Profiles](https://www.manageengine.com/products/desktop-central/help/api/cloud/java-manager-list-jrm-profiles.html) response (`jrm_profile_id` field). ### Request Body Send Java rules inside the `jrm_payloads` object. Use `urls` for website-specific rules (provide webdomain IDs from Web Domain Management) OR `groups` for group-based rules (provide group IDs). Do not mix both in the same payload. Actions: `0` = Block Java, `1` = Run (allow with optional `java_version`), `2` = Default (browser setting). The `block_message` field is only available when `action=0` (Block) to show a custom message to users. `application/json` **JSON Object:** Java rules payload. Pick URL or Group from the dropdown. ## Examples ### URL Rules #### Sample Request ```curl curl --request POST \ --url https://appdomains/bsp/api/v1/bmp/jrm/{jrm_profile_id}/jrm_payloads \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{}' ``` #### Sample Request Body — URL Rules ##### Block Java on URLs with message ```json { "jrm_payloads": { "urls": [ { "action": 0, "webdomain_ids": [ "3", "1" ] } ], "block_message": "Java applet execution is blocked by security policy" } } ``` ##### Allow Java on URLs ```json { "jrm_payloads": { "urls": [ { "java_version": "1.7.0_04", "action": 1, "webdomain_ids": [ "3", "1" ] } ] } } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` **JSON Object:** Response after adding a new payload. - **jrm_payloads** (JSON Array): The newly created payload with its rules. The `config_data_item_id` inside `jrm_details` is needed for future Modify/Delete operations. ### HTTP Code 400 Response Body: `application/json` **JSON Object** - **errorcode** (string): Error identifier (for example, `IAM0006` for an invalid field value). - **errormsg** (string): Describes which field or value is invalid. ### HTTP Code 401 Response Body: `application/json` **JSON Object** - **errorCode** (long): Unauthorized error code returned when authentication credentials are missing, expired, or invalid (`authentication=required`). - **errorMsg** (string): Authentication failure reason. ### HTTP Code 403 Response Body: `application/json` **JSON Object** - **errorCode** (long): Forbidden error code returned when the authenticated user does not have the required uem-roles (for example, `DataEncryption_Admin` or `DataEncryptionRecoveryKey_Admin`). - **errorMsg** (string): Message indicating insufficient privileges to access this resource. ### HTTP Code 404 Response Body: `application/json` **JSON Object** - **errormsg** (string): Message indicating the requested resource was not found. ### HTTP Code 429 Response Body: `application/json` **JSON Object** - **errorCode** (long): Rate limit error code returned when the API call threshold (configured via threshold/duration in security XML) is exceeded; client is locked out for lock-period minutes. - **errorMsg** (string): Rate limit exceeded message with retry guidance. ### HTTP Code 500 Response Body: `application/json` **JSON Object** - **errormsg** (string): Description of the server-side error. ## Sample Responses ### HTTP 200 #### Created payload ```json { "jrm_payloads": [ { "payload_type": "64101", "block_message": "", "jrm_details": [ { "config_data_item_id": "971", "urls": [ { "java_version": "1.7.0_04", "action": "1", "id": "3", "url": "localhost" } ], "groups": [] } ], "default_rias": false, "config_label": "JAVA_RULES_MANAGER" } ] } ``` ### HTTP 400 #### Webdomain not found ```json { "errorcode": "IAM0006", "errormsg": "Field value of {0} is invalid." } ``` #### Group not found ```json { "errorcode": "IAM0006", "errormsg": "Field value of {0} is invalid." } ``` ### HTTP 401 #### Unauthorized ```json { "errorCode": "IAM0001", "errorMsg": "Authentication key is invalid. Please regenerate the key and try again." } ``` ### HTTP 403 #### Forbidden ```json { "errorCode": "FORBIDDEN", "errorMsg": "You do not have permission to access this resource" } ``` ### HTTP 404 #### Profile not found ```json { "errormsg": "Profile not found" } ``` ### HTTP 429 #### Rate limit exceeded ```json { "errorCode": "RATE_LIMIT_EXCEEDED", "errorMsg": "You have exceeded the maximum number of API calls. Please try again later." } ``` ### HTTP 500 #### Server error ```json { "errormsg": "Internal Server error, Please try again in a moment." } ``` ## Rate Limit ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 60 | **Lock period:** 5 minutes Duration — Time window for the threshold. Threshold — Number of API calls allowed within the specified duration. Lock Period — Wait time before consecutive API requests.