Oracle by Example brandingGet Started with User Accounts REST API - Manage User Accounts

section 0Before You Begin

This 20-minute tutorial shows you how to manage user accounts.

Before you begin, you should have access to a user whose account you can modify and reset password.


section 1Creating a User Account

Creating a user account is only possible if your environment isn't configured to automatically create accounts. If accounts are automatically created, you can skip this exercise.

  1. Add a request to ##_UserAccountsCollection.

    Add Requests to Collection
  2. Give the request the name Create a User Account.
  3. Click Save to ##_UserAccountsCollection.
  4. Specify the method as POST.
  5. Enter the url:

    {{url}}/hcmRestApi/resources/latest/userAccounts

  6. Give the request the following headers:

    Note: Headers can be saved in presets in postman for reuse.

    Key Value
    Content-Type application/vnd.oracle.adf.resourceitem+json
    REST-Framework-Version 4
  7. Add the request body. None is selected by default, raw must be used to add content.

    Value replacements will need to be made in the body for your person id and user name.

    Request Body:

    {	
      "PersonId": "12345",
      "Username": "john.doe@example.com",
      "CredentialsEmailSentFlag": "true"
    }
  8. Click Send.

    The response should be 201 Created.

  9. Click Save.


section 2Query a User Account by User Name

  1. Add a request to ##_UserAccountsCollection.

  2. Give the request the name Query Account by User Name.
  3. Click Save to ##_UserAccountsCollection.
  4. Specify the method as GET.
  5. Enter the url:

    Note:Replace UserName in the URL with the user name of the user whose account you are accessing.

    {{url}}/hcmRestApi/resources/11.13.18.05/userAccounts?q=Username = 'john.doe@example.com'

  6. Give the request the following headers:

    Note: Headers can be saved in presets in postman for reuse.

    Key Value
    REST-Framework-Version 4
  7. Click Send.

    The response should be 200 OK.

  8. Click Save.

section 3Update the Account User Name

  1. In the response for Query Account by User Name click the self link for the user account.

  2. Click Save As and give the request the name Update the Account User Name.
  3. Click Save to ##_UserAccountsCollection.
  4. Specify the method as PATCH.
  5. Give the request the following headers:

    Note: Headers can be saved in presets in postman for reuse.

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.resourceitem+json
  6. Add the request body. None is selected by default, raw must be used to add content.

    Request Body:

    {
    		"Username": "john.b.doe@example.com"
    
    } 
  7. Click Send.

    The response should be 200 OK.

    You can see the updated user name in the response.

  8. Click Save.

section 4Update the Account Password

  1. In the response for Query Account by User Name click the updatePassword for the user account.

  2. Click Save As and give the request the name Update the Account Password.
  3. Click Save to ##_UserAccountsCollection.
  4. Specify the method as POST.
  5. Give the request the following headers:

    Note: Headers can be saved in presets in postman for reuse.

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.action+json
  6. Add the request body. None is selected by default, raw must be used to add content.

    Request Body:

    {
     "pwd": "Password123"
    } 
  7. Click Send.

    The response should be 200 OK.

  8. Click Save.

section 5Trigger a Password Reset

  1. In the response for Query Account by User Name click the resetPassword link for the user account.

  2. Click Save As and give the request the name Trigger the Account Password Reset.
  3. Click Save to ##_UserAccountsCollection.
  4. Specify the method as POST.
  5. Give the request the following headers:

    Note: Headers can be saved in presets in postman for reuse.

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.action+json
  6. Click Send.

    The response should be 200 OK.

  7. Click Save.

next stepNext Tutorial

Manage User Roles