Oracle Cloud ERP – Employee Creation From UI and Using REST API


———Employee Creation in Cloud ERP Using REST API—————–


  1. Create an Employee from UI
    Navigation :
    (Search Person) –> My Client Groups –> Person Management
    (Create Person) –> My Client Groups –> New Person –> Hire an Employee
  2. GET All Employees

URI: /hcmRestApi/resources/11.13.18.05/emps

URL: https://adc2-zrej-fa-ext.oracledemos.com/hcmRestApi/resources/11.13.18.05/emps

  1. GET a specific Employee
    /hcmRestApi/resources/11.13.18.05/emps/{empsUniqID}
    empsUniqID: integer

https://adc2-zrej-fa-ext.oracledemos.com/hcmRestApi/resources/11.13.18.05/emps?q=PersonId=300000047606111

This is the hash key of the attributes which make up the composite key— PersonId, EffectiveStartDate, CitizenshipId, ReligionId, PassportId and DriversLicenseId —for the Employees resource and used to uniquely identify an instance of Employees. The client should not generate the hash key value. Instead, the client should query on the Employees collection resource with a filter on the primary key values in order to navigate to a specific instance of Employees.

For example: emps?q=PersonId=;EffectiveStartDate=;CitizenshipId=;ReligionId=;PassportId=;DriversLicenseId=

“PersonId”: 300000047606111,
“EffectiveStartDate”: “2009-03-09”,
“CitizenshipId”: null,
“ReligionId”: null,
“PassportId”: null,
“DriversLicenseId”: null,


4.create an employee : using REST API:POST

URI: /hcmRestApi/resources/11.13.18.05/emps

FullURL : https://adc2-zrej-fa-ext.oracledemos.com/hcmRestApi/resources/11.13.18.05/emps

--Query to get employee name and person number details
SELECT 
 papf.PERSON_ID,
 papf.EFFECTIVE_START_DATE,
 papf.EFFECTIVE_END_DATE,
 ppn.PERSON_NAME_ID,
ppn.SUFFIX,
ppn.DISPLAY_NAME,
ppn.FULL_NAME,
ppn.LIST_NAME,
ppn.ORDER_NAME,
ppn.LEGISLATION_CODE,
ppn.NAME_TYPE,
 papf.BUSINESS_GROUP_ID,
 papf.CREATED_BY,
 papf.PERSON_NUMBER,
 papf.PRIMARY_EMAIL_ID,
 papf.PRIMARY_PHONE_ID,
 papf.MAILING_ADDRESS_ID,
 papf.PRIMARY_NID_ID
FROM  per_all_people_f  papf, per_person_names_f ppn
WHERE 1=1
and papf.person_id = ppn.person_id
order by papf.creation_date desc 
--Query to get Employee Person details, account, phone, email, le details, assignment details

SELECT
      papf.person_id,
	  hauft.NAME LE_Employer,
      ppn.full_name,
      papf.person_number,
      papf.effective_start_date,
      papf.effective_end_date,
      papf.business_group_id,
      ped.email_address,
      pp.phone_type,
      pp.phone_number,
	  pni.NATIONAL_IDENTIFIER_TYPE,
      pni.NATIONAL_IDENTIFIER_NUMBER ,
	  PAF.ADDRESS_LINE_1, PAF.ADDRESS_LINE_2, PAF.TOWN_OR_CITY, PAF.POSTAL_CODE,
	  pu.user_id,
	  pu.username,
      papf.primary_email_id,
      papf.primary_phone_id,
      papf.mailing_address_id,
      papf.primary_nid_id
  FROM
      per_all_people_f     papf,
      per_person_names_f   ppn,
      per_email_addresses  ped,
      per_phones            pp,
	  PER_NATIONAL_IDENTIFIERS pni,
	  PER_ADDRESSES_F PAF ,
	  PER_USERS PU,
	  HR_ORG_UNIT_CLASSIFICATIONS_F houcf, 
	  HR_ALL_ORGANIZATION_UNITS_F haouf, 
	  HR_ORGANIZATION_UNITS_F_TL hauft,
	  per_all_assignments_m paam
	  
  WHERE
          1 = 1
      AND papf.person_id = ppn.person_id
      AND ppn.person_id = 300000210840890
      AND ppn.name_type = 'GLOBAL'
      AND papf.person_id = ped.person_id
      AND papf.primary_email_id = ped.email_address_id
      AND pp.person_id = papf.person_id 
--and pp.phone_type ='WM'
      AND pp.phone_id = papf.primary_phone_id
	  AND pni.person_id = papf.person_id 
	  AND papf.primary_nid_id = pni.NATIONAL_IDENTIFIER_ID
	  AND papf.mailing_address_id = paf.address_id
 	  AND papf.person_id = pu.person_id
AND haouf.ORGANIZATION_ID = houcf.ORGANIZATION_ID 
AND haouf.ORGANIZATION_ID = hauft.ORGANIZATION_ID 
AND haouf.EFFECTIVE_START_DATE BETWEEN houcf.EFFECTIVE_START_DATE AND houcf.EFFECTIVE_END_DATE 
AND hauft.LANGUAGE = 'US'
AND hauft.EFFECTIVE_START_DATE = haouf.EFFECTIVE_START_DATE 
AND     hauft.EFFECTIVE_END_DATE = haouf.EFFECTIVE_END_DATE 
AND houcf.CLASSIFICATION_CODE = 'HCM_LEMP' 
AND     SYSDATE BETWEEN hauft.effective_start_date AND hauft.effective_end_date
AND     hauft.organization_id = paam.legal_entity_id
and     paam.person_id = papf.person_id
and     paam.primary_assignment_flag = 'Y'
and     paam.assignment_type = 'E'
and     paam.effective_latest_change = 'Y'
and     sysdate between paam.effective_start_date and paam.effective_end_date
and     sysdate between papf.effective_start_date and papf.effective_end_date

--Employee creation sample request payload

{
  "Salutation": "MR.",
  "LegalEntityId": 300000046974965,
  "FirstName": "Sreeram",
  "MiddleName": "NA",
  "LastName": "ErpteCh",
  "DisplayName" : "Sreeram NA ErpteCh",
  "WorkPhoneCountryCode" : "1",
  "WorkPhoneAreaCode" : "1",
  "WorkPhoneNumber" : "125-993-0000",
  "WorkMobilePhoneCountryCode" : "1",
  "WorkMobilePhoneAreaCode" : "1",
  "WorkMobilePhoneNumber" : "459-993-0000",
  "HomeFaxCountryCode":"1",
  "HomeFaxAreaCode":"1",
  "HomeFaxNumber":"1111669",
  "HomePhoneCountryCode":"1",
  "HomePhoneAreaCode":"1",
  "HomePhoneNumber":"122993334",
  "NameSuffix":"Jr.",
  "NationalIdExpirationDate" : "4712-12-31",    
  "WorkEmail" : "sreeramtech@test.com",
  "AddressLine1" : "Address Line1",
  "AddressLine2" : "Address Line2",
  "AddressLine3" : null,
  
  
              "City": "San Francisco",
            "Region": "San Francisco",
            "Region2": "CA",
            "Country": "US",
            "PostalCode": "94123",
  
  "CitizenshipLegislationCode" : "US",
  "CitizenshipStatus" : "A",
  "PassportNumber" : "21557749",
  "PassportIssueDate" : "2002-12-31",
  "LicenseNumber" : "9955500858",
  "DateOfBirth": "1990-09-09",
  "Ethnicity": "8",
  "Gender" : "M",
  "MaritalStatus" : "S",
  "NationalIdCountry": "US",
  "NationalId": "254-44-3025",
  "NationalIdType": "SSN",
  "UserName":"sreeramerptech",
  "assignments" :  
    [
    {
     "AssignmentName": "Analyst",
     "BusinessUnitId": 300000046987012,
     "JobId" : "300000047336894",
     "WorkerCategory" : "WC",
     "AssignmentCategory" : "FR",
     "WorkingAtHome" : "N",
     "WorkingAsManager" : "N",
     "SalaryCode" : "H",
     "WorkingHours" : "12",
     "Frequency" : "D",
     "SalaryAmount" : "100000",
     "SalaryBasisId": 300000048365126,
	 "ManagerAssignmentId": 300000049159643,
     "ManagerId": 300000049155263,
     "ActionCode" : "HIRE", 
     "ActionReasonCode" : "NEWHIRE",
     "AssignmentStatus" : "ACTIVE",
     "WorkTaxAddressId": null,
     "ManagerType" : "LINE_MANAGER" 
     }
     ]
}

Comments |0|

Legend *) Required fields are marked
**) You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Category: OracleSaaS