The timeRecordEventRequests REST API requires both IN and OUT time to be supplied in the payload to create time entries in Oracle OTL. In real time clock integrations with Oracle, clock systems can send only either IN or OUT entry at a time (real time entries), so timeRecordEventRequests REST API will not work in this case. To handle this real time clock scenarios, Oracle has exception mechanism through which IN and OUT entries can be captured.
Below is the sample REST API payload to create IN time entry from clock system.
Request URL: /hcmRestApi/resources/11.13.18.05/timeEventRequests/
Method: Post
Content Type: application/json
Sample Payload for IN time:
{
“requestNumber”:”1000″, //–** Just a running Sequence number. Should be unique for every trx
“requestTimestamp”:”2021-07-30T15:30:00.000+01:00″, //–** runtime (sysdate)
“sourceId”:”CLOCK_SYSTEM”, //–** Setup & Maintenance — Define Time Entry Configuration — Workforce Management Lookups — ORA_HWM_TCD_SUPPLIERS — Pick Lookup Code
“timeEvents”:[
{
“deviceId”:”111″, //–** Setup & Maintenance Time Device Processing Profiles — Device Id
“eventDateTime”:”2021-07-19T08:00:00.000+01:00″, //–** IN Time
“supplierDeviceEvent”:”CLOCK_IN”, //–** Setup & Maintenance — Time Collection Device Event Mapping — Time Device Event Mappings
“reporterId”:”101″, //–** Reporting Person Number from Oracle
“reporterIdType”:”PERSON”, //–** Constant value
“timeEventAttributes”:
[
{
“name”:”PayrollTimeType”, //–** Time entry attribute context
“value”:”Regular Hours” //–** Time entry attribute value
}
]
}
]
}
Once the request is submitted, response status “201 created” will indicate the successful creation of IN time entry in Oracle. But this record will be in exception in time entries screen as stated below with error “A value must be provided for start time and stop time attributes”.
So, this required another OUT time entry to complete the transaction. Once clock system sends the OUT entry payload in consecutive run then exception will be cleared automatically in the system.
Below is the sample REST API payload to create OUT time entry from clock system.
Sample Payload for OUT time:
{
“requestNumber”:”1001″, //–** Just a running Sequence number. Should be unique for every trx
“requestTimestamp”:”2021-07-30T15:30:00.000+01:00″, //–** runtime (sysdate)
“sourceId”:”CLOCK_SYSTEM”, //–** Setup & Maintenance — Define Time Entry Configuration — Workforce Management Lookups — ORA_HWM_TCD_SUPPLIERS — Pick Lookup Code
“timeEvents”:[
{
“deviceId”:”111″, //–** Setup & Maintenance — Time Device Processing Profiles — Device Id
“eventDateTime”:”2021-07-19T11:00:00.000+01:00″, //–** OUT Time
“supplierDeviceEvent”:”CLOCK_OUT”, //–** Setup & Maintenance — Time Collection Device Event Mapping — Time Device Event Mappings
“reporterId”:”101″, //–** Reporting Person Number from Oracle
“reporterIdType”:”PERSON”, //–** Constant value
“timeEventAttributes”:
[
{
“name”:”PayrollTimeType”, //–** Time entry attribute context
“value”:”Regular Hours” //–** Time entry attribute value
}
]
}
]
}
Below is the time entry record where the exception is cleared from the transaction.