Answers.Body: <p>Make sure the value 14 for acl_role_id is correct.</p>
  
  <p>ACL role is an option value pair and should to be set as one of the existing value available from <code>civicrm/admin/options/acl_role?reset=1</code>.</p>
  
  <p>UPDATE - just tried on my local and looks like a bug to me. Can you raise this as a new ticket at <a href="https://lab.civicrm.org/dev/core/issues/new" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/new</a>?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-17T11:55:36.160Z
Answers.Text: The acl_role_id is correct (I checked both civicrm_group and role_id in database). I tried by using UI and it worked. But not working using API.
Answers.UserDisplayName: deepak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-17T11:10:22.337Z
Answers.LastActivityDate: 2019-01-17T12:59:12.753Z
Answers.LastEditDate: 2019-01-17T12:59:12.753Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.<br></p>
  
  <blockquote>
    <p>Input json</p>
  </blockquote>
  
  <pre><code>     $result = civicrm_api3('AclRole', 'create', [
    'debug' =&gt; 1,
    'sequential' =&gt; 1,
    'acl_role_id' =&gt; 14,
    'entity_table' =&gt; "civicrm_group",
    'entity_id' =&gt; 54,
    'is_active' =&gt; 1,
  
  ]);
  </code></pre>
  
  <blockquote>
    <p>Output json</p>
  </blockquote>
  
  <pre><code>"values": [
      {
          "id": "14",
          "acl_role_id": "",
          "entity_table": "civicrm_group",
          "entity_id": "54",
          "is_active": "1"
      }
  ]
  </code></pre>
  
  <p>I already providing a "acl_role_id", but in the output json object, it is showing a blank</p>
  
Tags: <api><acl>
Title: Not inserting a ACL Role using ACL Role API
ThreadText: # Not inserting a ACL Role using ACL Role API
  
  (Asked by: username_0 on 2019-01-16)
  
  I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.
  
  Input json
  
       $result = civicrm_api3('AclRole', 'create', [
    'debug' => 1,
    'sequential' => 1,
    'acl_role_id' => 14,
    'entity_table' => "civicrm_group",
    'entity_id' => 54,
    'is_active' => 1,
  
  ]);
  
  
  Output json
  
  "values": [
      {
          "id": "14",
          "acl_role_id": "",
          "entity_table": "civicrm_group",
          "entity_id": "54",
          "is_active": "1"
      }
  ]
  
  I already providing a "acl_role_id", but in the output json object, it is showing a blank
  
  **Tags:** api, acl
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-17. Score: 1
  
  Make sure the value 14 for acl\_role\_id is correct.
  
  ACL role is an option value pair and should to be set as one of the existing value available from `civicrm/admin/options/acl_role?reset=1`.
  
  UPDATE - just tried on my local and looks like a bug to me. Can you raise this as a new ticket at <https://lab.civicrm.org/dev/core/issues/new>?
  
  > **Comments:**
  > **username_0**: The acl_role_id is correct (I checked both civicrm_group and role_id in database). I tried by using UI and it worked. But not working using API.  
  
  ---
  
  