Provide a User with the Bill Management Role

Roger wants to assign a role to the user to access the Bill Management portal. To do this, he needs to:
  1. Get the role ID using the GET action on the Roles resource
  2. Get the user ID using the GET action on the Users resource
  3. Assign a role to the user using the PATCH action on the Roles resource

Step 1: Get the Role ID

Example URL

Here's an example of the resource URL:

GET

/hcmRestApi/scim/Roles?filter=displayname (for example, "Customer Account Payable Specialist")

Note:

Customer Account Payable Specialist is the predefined role that gives users access to the Bill Management portal. If you define a custom roles for that purpose, then use the display name of the custom role.

Example Response

Here's an example of the response body in JSON format:

{
 "itemsPerPage": 1,
 "startIndex": 1,
 "Resources": [
   {
     "id": "239A437C1102190FE050F40A1C3675E9",
     "meta": {
       "location": "https://<server>/hcmRestApi/scim/Roles/239A437C1102190FE050F40A1C3675E9",
       "resourceType": "Role",
       "created": "2015-12-01 09:08:08.072",
       "lastModified": "2019-08-20 11:22:13.910"
     },
     "schemas": [
       "urn:oracle:apps:scim:schemas:fa:1.0:Role"
     ],
     "name": "ORA_ARB_CUSTOMER_ACCOUNTS_PAYABLE_SPECIALIST_JOB",
     "displayName": "Customer Accounts Payable Specialist",
     "description": "Responsible for performing customer self-service bill management tasks.",
     "category": "JOB",
     "members": [
       {
         "value": "51B69D714FF9FCA2F2346447ED434ACA"
       },
       {
         "value": "2968AFB5FD2CE7B37FAD8518A59D23F5"
       }
     ]
   }
 ]
}

Step 2: Get the User ID

Example URL

GET

/hcmRestApi/scim/Users?filter=username (for example, XavierDMachen@dayrep.com)

Example Response

Here's an example of the response body in JSON format:

{
 "itemsPerPage": 1,
 "startIndex": 1,
 "Resources": [
   {
     "id": "9087AE4DA3507876E050F40A8B9648E8",
     "meta": {
       "location": "https://<server>/hcmRestApi/scim/Users/9087AE4DA3507876E050F40A8B9648E8",
       "resourceType": "User",
       "created": "2019-08-21 06:16:45.000",
       "lastModified": "2019-08-21 06:16:45.093"
     },
     "schemas": [
       "urn:scim:schemas:core:2.0:User",
       "urn:scim:schemas:extension:fa:2.0:faUser"
     ],
     "userName": "XavierDMachen@dayrep.com",
     "name": {
       "familyName": "Machen",
       "givenName": "Xavier"
     },
     "displayName": "Xavier Machen",
     "preferredLanguage": "en",
     "emails": [
       {
         "value": "XavierDMachen@dayrep.com",
         "type": "W",
         "primary": true
       }
     ],
     "urn:scim:schemas:extension:fa:2.0:faUser": {
       "userCategory": "DEFAULT"
     },
     "active": true
   }
 ]
}

Step 3: Assign a Role to the User

Example URL

Here's an example of the resource URL:

PATCH

/hcmRestApi/scim/Roles/<RoleId> (for example, "239A437C1102190FE050F40A1C3675E9")

Example Request

Here's an example of the request body in JSON format:

{
	"schemas": ["urn:oracle:apps:scim:schemas:fa:1.0:Role"],
    "members":
    [
    	{
    		"value":"9087AE4DA3507876E050F40A8B9648E8", 
    		"operation":"ADD"
    	}
    ]
}

Note:

The ID in "value" is the user ID that was retrieved in the get the user ID step.

Example Response

Here are examples of the response:
  • A successful response has a 204 response code and no body in the response.
  • An unsuccessful response has a 400 response code.