Oracle Unified Directory 12c or OUD supports REST API's to administer OUD
configuration and manage directory data. There are three rest APIs is available in OUD:
The REST Data Management API, the SCIM REST Data Management API and the REST Administration API
The REST Data Management API allows you to manage directory data.
For example you may want to list users, create groups or modify and delete entries.
The SCIM REST API also allows you to manage directory data but uses the SCIM API standard.
The REST Administration API's allow you to administer the OUD configuration.
For example you may want to update logger details create extensions or modify network groups.
Let's first look at how to manage directory data using the REST Data Management API.
To demonstrate this we'll use the Postman application.
Let's first create a new entry.
All REST Data Management API calls are made to the HTTPS port of OUD
using the endpoint /rest/v1/directory.
Here we make a POST request to the endpoint and pass the details of the entry to be created in the body.
In this case we are creating a user "test user 1" with relevant attributes.
We click send to make the API call.
A "201 created" message is returned.
This and the details in the response show the user is created successfully.
Now let's modify the user we created.
Here we make a PATCH request to modify "test user 1", and in the body
pass the details of the attributes to update. In this case we are adding the
description attribute with a value "Test User 1".
Click send to make the request.
A "200 OK" message is returned.
This and the details in the response show the user is modified successfully.
Now let's take a look at the SCIM REST Data Management API.
Let's first list all the users in the directory.
SCIM REST API calls are also made to the HTTPS port of OUD,
but use the endpoint /iam/directory/oud/scim/v1.
To list all users we make a GET request to this endpoint with /users and click Send.
A "200 OK" message is returned and the list of all the users in the directory is displayed
Now using the SCIM API let's delete the "test user 1" we created earlier.
In order to do this we need to find the users ID value.
Click the search icon and enter "test user 1" and copy the ID value for this user.
Now select the Delete User Entry.
Here we make a DELETE request to the same endpoint but add the ID of the user we want to delete "test user 1".
After clicking send a "204 No Content" message is received indicating the user was deleted successfully.
To prove the user was deleted select Get User Details.
Here we make a get request to the same endpoint with the ID of the user we deleted.
After clicking Send a "404 Not Found" message is displayed indicating the user does not exist.
Now let's take a look at the REST Administration API and how it can be used to view or modify the OUD configuration.
First let's retrieve the File Based Default Logger flag values.
REST Administration API calls are made to the HTTPAdminConnectorPort of OUD and use the endpoint /rest/v1/admin.
Here we make a GET request to the endpoint to fetch the OUD logger information.
After clicking send a "200 OK" message is displayed and the logger attributes are returned.
At present the file based debug logger is disabled so let's enable it.
Here we make a PATCH request to the same endpoint, and in the body we pass the value true for ds-cfg-enabled, and click Send.
A "200 OK" message is displayed and the logger attributes are returned with the logger now enabled.
Now let's get details about the server instance.
Here we make a GET request to the admin endpoint and in the body pass the parameters to retrieve details about the OUD instance.
After clicking send a "200 OK" response is received and details about the server instance are displayed.
For more information on Configuring OUD for use with REST API's,
and the postman collections shown,
please see our tutorial.