Check for username in OKTA before creating one in Active directory

Developing the application,that check for the Username in OKTA before creating one in Active directory.
Can I know the java webservice that be used to check for username in OKTA and provide the real time results.

Thanks in Advance,

Hi @Sindhu

You can do a search on the Okta org using filter and see if there is a response (user exists) or empty response (user doesn’t exist).

Here is an example in Java using OkHttpClient

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "SSWS API_TOKEN_HERE")

Response response = client.newCall(request).execute();