Add a Directory Entry

You can use the POST method to add entries to the directory.

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

See Send Requests.

This example shows how to add the entries in the container ou=People,dc=example,dc=com.

To add the entries, submit a request to http://host:port/rest/v1/directory using the POST method with the following payload:

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

Example

curl -i -X POST -u cn=Directory Manager:*******  -H Content-type:application/json http://myhost:7001/rest/v1/directory

The following shows an example of the response:

HTTP/1.1 201 Created

The following shows an example of the response using the above mentioned payload.

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