Clock In/Out
The Clock API allows you to create one or more clock records in WFM. Unlike other REST APIs, this API does not post information directly to the main view (Track Record) for clock data. Instead, records are posted to Stage Record tab of Clock in the Input Interfaces view. The scheduled job "Process Stage Track Record" validates and moves these records to Track Record at scheduled intervals. You can choose to trigger the scheduled job immediately as a part of the API request, using the async_flg parameter on the request.
URL
POST ..lgfapi/v10/stage_track_record/clock_inout/
Request Body
- message_id - Mandatory field of string type that would uniquely identify a payload. Max length – 50
- async_flg - true/false; default true
- When false:
- Posts data to Stage Record of Clock Input Interface and triggers "Process Stage Track Record" immediately after.
- If all records are processed successfully, response 204 "No Content" is returned with no response body. All the records show up in Track Record view.
- If one or more records fail validations, response 400 “Bad Request” is returned with the count of failed records in the response. Since clock records need to be sequential and are dependent on other clock records (such as facility clock-in before work area clock-in), no records will be processed after the first failure has been encountered.
Note: It is advisable not to use async_flg = false if you intend to post large volume of records since the calling system may have to wait for considerable time to receive a response from WFM. - When true:
- Posts data to Stage Record of Clock Input Interface
- Returns response 202 - "Accepted" with no response body.
- Posted records remain in Stage Record of Clock Input Interface for further processing.
- When false:
- cico_data - The table below describes the fields within this parameter:
Name | Required | Type | Description |
facility_code | X | String | Facility code |
univ_id_1 | C | String | Employee ID of the user that needs to be clocked. Mandatory for all cico_types except F7 and F8. If F7 or F8, either univ_id_1 or team should be provided, not both. |
cico_ts | X | DateTime |
Clock in/out date time Format: YYYYMMDDHHMMSS Example: 20190727052020 |
cico_type | X | String |
Valid Values: F1, F2, F3, F4, F5, F6, F7, F8, F9, F10 F1 - Facility Clock In F2 - Break Clock In F3 - Break Clock Out F4 - Facility Clock Out F5 - Work Area Clock In F6 - Work Area Clock Out F7 - VAS Activity Clock In F8 - VAS Activity Clock Out F9 - Manual Activity Clock In F10 - Manual Activity Clock Out |
originating_system | X | String |
Valid Values: M and S M - M is used to create new data. If M is sent for data that already exists, the record fails to be processed S - S is used to update existing data. If S is sent for data that doesn't exist, the record is inserted as new data. Note: This check is done by "Process Stage
Track" process.
|
work_area | C | String |
Work Area Code. Required when cico_type is F5, F6, F7, F8, F9, F10. If F7 or F8, the work area code should be associated to the VAS activity. If F9 or F10, the work area code should be associated to the manual activity. |
break | C | String | Name of the break taken by employee. Required when cico_type is F2 or F3. |
activities | C | String | Work Area Activity Code of the VAS or Manual activity. Required when cico_type is F7, F8, F9, F10. |
team | C | Required only for F7 and F8, if univ_id_1 is not provided. If univ_id_1 is provided, this field should not be populated. |
Request Body Example (JSON)
Instance Create
{
"message_id": 12345,
"async_flg": false,
"cico_data": [{
"facility_id__code": "QATST01",
"univ_id_1": "1115472",
"cico_ts": "20230505063027",
"cico_type": "F7",
"originating_system": "M",
"work_area": "VASWABN",
"activities”: "BNVASACT01",
"team”: ""
}]
}
Bulk Create
{
"message_id": 12345,
"async_flg": false,
"cico_data": [
{
"facility_id__code": "QATST01",
"univ_id_1": "",
"cico_ts": "20230505063027",
"cico_type": "F7",
"originating_system": "M",
"work_area": "VASWABN",
"activities”: "BNVASACT01",
"team”: "T345"
},
{
"facility_id__code": "QATST01",
"univ_id_1": "",
"cico_ts": "20230505072014",
"cico_type": "F8",
"originating_system": "M",
"work_area": " VASWABN"
"activities”: " BNVASACT01",
"team”: "T345"
}
]
}
Request Body Example (XML)
Instance Create
<request>
<message_id>12345</message_id>
<async_flg>true</async_flg>
<cico_data>
<list-item>
<facility_code>QA3PLEST</facility_code>
<univ_id_1>12453</univ_id_1>
<cico_ts>20230510092030</cico_ts>
<cico_type>F9</cico_type>
<originating_system>M</originating_system>
<work_area>MISC</work_area>
<break></break>
<activities>Maintenance</activities>
</list-item>
</cico_data>
</request>
Bulk Create
<request>
<message_id>12345</message_id>
<async_flg>true</async_flg>
<cico_data>
<list-item>
<facility_code>QA3PLEST</facility_code>
<univ_id_1>23145</univ_id_1>
<cico_ts>20230510092030</cico_ts>
<cico_type>F9</cico_type>
<originating_system>M</originating_system>
<work_area>MISC</work_area>
<break></break>
<activities>Maintenance</activities>
</list-item>
<list-item>
<facility_code>QA3PLEST</facility_code>
<univ_id_1>23145</univ_id_1>
<cico_ts>20230510104511</cico_ts>
<cico_type>F10</cico_type>
<originating_system>M</originating_system>
<work_area>MISC</work_area>
<break></break>
<activities>Maintenance</activities>
</list-item>
</cico_data>
</request>