Programmatically Create/Update User and assign roles in oracle Fusion using the REST Web Services Part 1

Programmatically Create/Update User and assign roles in oracle Fusion using the REST Web Services Part 1

Below are the steps that will be covered in this Post to Manage the User information using  REST Web Service using the Postman Tool

1) POST method to create a user along with Password and email using below REST Web service
     /hcmRestApi/scim/Users
2) GET method to query the user using below REST Web service
    /hcmRestApi/scim/Users/{id}
3) PATCH method to update and assign the Roles to the user using below REST Web service
    /hcmCoreSetupApi/scim/Roles/{id} 
4) PATCH method to update the user information using below REST Web service
    /hcmRestApi/scim/Users/{id} 

     Three Operations will be Performed in Postman Tool

1) POST Operation used for CREATION
2) GET Operation used for QUERY
3) PATCH Operation used for UPDATE 

REST Web Service Used for Creating the User

hcmRestApi/scim/Users
     
    Preparation of the REST Web Service URL

https://<host>:<port>/hcmRestApi/scim/Users

<host>:<port> in nothing but application Environment

1) POST Operation for Creating the User

Provide the Authorization user name and password who have access to execute this webservice.



Content-Type               application/json

 


REQUEST Payload
 
{
 "schemas":[
  "urn:scim:schemas:core:2.0:User"
 ],
 "name":{
  "familyName":"ABDUL",
  "givenName":"KALAM"
 },
 "active":true,
 "userName":"ABDUL.KALAM",
 "emails":[
  {
   "primary":true,
   "value":"apjkalam@oracle.com",
   "type":"W"
  }
 ],
 "displayName":"Kalam Abdul",
 "externalId":"externalId4232:",
  "password" : "humanity123"
}


Load the above mention Creation of User Payload in the Body section of Postman Tool and Execute the webservice using the Send button.


Status Shows : 201 Created
It will provide the below response.

RESPONSE

 
{
    "id""AFF234DC29119F6FE050DD0AFA573C12",
    "meta": {
        "location""https://<host>:<port>/hcmRestApi/scim/Users/AFF234DC29119F6FE050DD0AFA573C12",
        "resourceType""User",
        "created""2020-09-23 10:16:42.000",
        "lastModified""2020-09-23 10:16:42.037"
    },
    "schemas": [
        "urn:scim:schemas:core:2.0:User",
        "urn:scim:schemas:extension:fa:2.0:faUser"
    ],
    "externalId""externalId4232:",
    "userName""ABDUL.KALAM",
    "name": {
        "familyName""ABDUL",
        "givenName""KALAM"
    },
    "displayName""Kalam Abdul",
    "preferredLanguage""en",
    "emails": [
        {
            "value""apjkalam@oracle.com",
            "type""W",
            "primary"true
        }
    ],
    "urn:scim:schemas:extension:fa:2.0:faUser": {
        "userCategory""DEFAULT"
    },
    "active"true
}

Verify using the below select statement

select * from per_users where username = 'ABDUL.KALAM'



Verify using the Application Navigation

Tools à Security Console



Search for the User "ABDUL.KALAM"





2) GET Operation for Querying the User information

REST Web Services

/hcmRestApi/scim/Users/{id}

{id} is nothing but the USER_GUID available in per_users table


USER_GUID : AFF234DC29119F6FE050DD0AFA573C12


Provide the Basic Authorization and Execute the REST Web Service by Clicking on Send Button.



Status Shows : 200 OK 

RESPONSE

{
    "id""AFF234DC29119F6FE050DD0AFA573C12",
    "meta": {
        "location""https://<host>:<port>/hcmRestApi/scim/Users/AFF234DC29119F6FE050DD0AFA573C12",
        "resourceType""User",
        "created""2020-09-23 10:16:42.000",
        "lastModified""2020-09-23 10:16:42.037"
    },
    "schemas": [
        "urn:scim:schemas:core:2.0:User",
        "urn:scim:schemas:extension:fa:2.0:faUser"
    ],
    "externalId""externalId4232:",
    "userName""ABDUL.KALAM",
    "name": {
        "familyName""ABDUL",
        "givenName""KALAM"
    },
    "displayName""Kalam Abdul",
    "preferredLanguage""en",
    "emails": [
        {
            "value""apjkalam@oracle.com",
            "type""W",
            "primary"true
        }
    ],
    "urn:scim:schemas:extension:fa:2.0:faUser": {
        "userCategory""DEFAULT"
    },
    "active"true
}


The Below two Steps will be Covered in the Part 2 URL Provided below,


3)  PATCH method to update and assign the Roles to the user
4)  PATCH method to update the user information


Please provide your comments and questions and follow below youtube for more information about this post.


Comments

Popular posts from this blog

Run BI Report Web Service Multiple Parameter date format Oracle Fusion BI Report xmlpserver/services/v2/ReportService WSDL

Oracle Fusion Multiple attachment for an Employee for a Single Document type HDL - HCM Data Loader