title: Cisco ISE API POST (500 Error)
body: <p>I am having difficulty creating a new endpoint in Cisco ISE using their API.  Here is my code:</p>
  
  <pre><code>import json
  import requests
  from requests.auth import HTTPBasicAuth
  
  # LAB Endpoint
  API_ENDPOINT ="myurl.com:9060/ers/config/endpoint"
  data= {
    "ERSEndPoint" : {
    "name": "name",
    "description": "description",
    "mac" : "99:99:99:99:99:99",
    "profileId" : "profileId",
    "staticProfileAssignment" : "false",
    "groupId" : "groupId",
    "staticGroupAssignment" : "false",
    "portalUser" : "portalUser",
    "identityStore" : "identityStore",
    "identityStoreId" : "identityStoreId",
    "customAttributes" : {
      "customAttributes" : {
        "key1" : "value1",
        "key2" : "value2"
        }
      }
    }
  }
  headers = {'Content-Type': 'application/json',
             'Accept': 'application/json'}
  r = requests.post(url = API_ENDPOINT, data = json.dumps(data), headers=headers, auth=('user', 'pwd'))
  print r.text
  </code></pre>
  
  <p>I keep receiving a 500 error.</p>
  
  <pre><code>&gt; {   "ERSResponse" : {
  &gt;     "operation" : "POST-create-endpoint",
  &gt;     "messages" : [ {
  &gt;       "title" : "CREATE: DB internal error during CRUD operation Unable to create the endpoint. ORA-02291: integrity constraint
  &gt; (CEPM.REF_ROLE_MASTER) violated - parent key not found\n",
  &gt;       "type" : "ERROR",
  &gt;       "code" : "CRUD operation exception"
  &gt;     } ],
  &gt;     "link" : {
  &gt;       "rel" : "related",
  &gt;       "href" : "https://ezlrtvise22.msstore.microsoftstore.com:9060/ers/config/endpoint",
  &gt;       "type" : "application/xml"
  &gt;     }   } }
  </code></pre>
  
  <p>It seems like it keeps throwing some weird Oracle DB key error.  Any suggestions?  I have tried using a REST Firefox extension to test as well and I still get the same error.  Thanks!</p>