Modify a Directory Entry

You can use the PATCH method to modify user attributes from the directory.

The command examples use the URL structure:
http(s)://host:port/rest/v1/directory

See Send Requests.

This example shows how to modify an attribute street for the uid=Marcia Garza.

To modify the attribute, submit a request to http://host:port/rest/v1/directory/<directory entry DN> using the PATCH method with the following payload:

{
  "opType": "replace",
  "attribute": "street",
  "values": ["California"]
}

Example

curl -i -X PATCH -u cn=Directory Manager:*******  -H Content-type:application/json http://myhost:7001/rest/v1/directory/uid=Marcia Garza,ou=People,dc=example,dc=com

If successful, the response body returns a status code of 200 that confirms the attribute update.

HTTP/1.1 200 OK

The following shows an example of the response.

{
  "msgType": "urn:ietf:params:rest:schemas:oracle:oud:1.0:ModifyResponse",
  "totalResults": 1,
  "searchResultEntries": [
    {
      "dn": "uid=Marcia Garza,ou=People,dc=oracle,dc=com",
      "attributes": {
        "mail": "mgarza@example.com",
        "sn": "mgarza",
        "cn": "mgarza",
        "pager": "+91 111 111 1111",
        "givenName": "Marcia Garza",
        "userPassword": "{SSHA512}password",
        "street": "California",
        "uid": "Marcia Garza",
        "objectClass": [
          "top",
          "organizationalperson",
          "person",
          "inetorgperson"
        ]
      }
    }
  ]
}