Get All Time Events

Return a list of the time event objects for the specified tenant.

Command

GET https://{server}/api/v1/{tenantId}/timeEvents

Parameters

Name Required Data Type Description Parameter Type
tenantId Yes String Unique identifier of the tenant. Path
expand No String

Adds additional detail to the output. Valid options:

  • statusDetail
  • attributes

Can be comma-separated into the same query. For example:

timeRecords?expand=attributes,statusDetail

Query
filter No String

Spring Expression Language (EL) filter. Allows you to filter by a set of records (for example: name eq 'name'). The following fields are filterable:

  • personId
  • timestampType
  • status
  • timeEventChunkId
  • rawTimeEventId
  • sourceId
  • type
  • template
  • timeRecordId
  • createdBy
  • createdTime
  • lastModifiedBy
  • lastModifiedTime
  • resourceDetailId

For more details on using the filter query parameter, see Filtering Guidelines.

Query
offset No String The number of items to skip before starting to collect the result set. Used with limit. Query
limit No String

The maximum number of results to return. Used with offset. Together, they determine the start index and number of records to return. For example, to return records 5 through 15 that have been sorted by name, use the following:

timeEvents?offset=5&limit=10&orderBy=name

Query
orderBy No String Order by fields, sort order. Query
select No String Select the specific fields to be returned. Query
count No String The number of records to fetch from the database. Query
groupBy No String Categorization of results (group by a field). Query

Responses

Status and Error Codes

See Common Status and Error Codes.

Successful Response Body

Field Description
hostId The identifier of the host instance that is returning the request.
status The status of the request. For a successful operation, this value is always 'SUCCESS'.
content

Returns an array of records.

Field Description
timeEventId The globally unique database-level identifier of the time event.
timeStampType

Type of timestamp. Valid values:

Value Description
START The start of a time event.
STOP The end of a time event.
STOP_START A time event that marks the stop of a previous event and the start of a new one. For example, a lunch start that triggers the end of a previous start work session and the beginning of a lunch break.
timestamp The DateTime of the time event.
timeRecordId For time events that are paired, this value is the time record for the pairing.
timeEventChunkId The ID for a series of paired events for a person over the course of one day.
rawTimeEventId The ID of the raw time event created by a terminal that is the source of the time event.
sourceId The applicationName of the apiKeys endpoint.
status The status of the time event. See Enumerations for more information on valid status values.
statusDetail

Additional detail about the status when there’s a validation error. For example:

  • If the status is PENDING_ATTRIBUTE, this means that the time event is missing one or more required attributes.
  • If the status is PAUSED, this means that the time bundle is locked because it's in a COMPLETED or PENDING_VERIFICATION status. The time bundle needs to be in the CREATED state in order to make changes to it.

Valid values:

Field Description
type The applicationName of the apiKeys endpoint.
code The error code of the status detail.
text Text of the error code.
syntheticFlag Indicates whether the time event was created by the system for an auto-clock out scenario.
parentTimeEventId If the syntethicFlag is set to true, this value is the ID of the clock in event that triggered the auto-clock out.
timeType A designation for the type of time event. For example, Break or Attendance.
userEditFlag Indicates whether the record was edited by a user.
template The name of the template associated with the time event.
type The type of event.
personId The globally unique database-level identifier of the person.
attributes

Additional custom attributes for the time event. The structure is dependent on the attributes defined in the time template.

rawTimestamp The DateTime the raw time event was created.
createdTime The DateTime the time event was created.
lastModifiedTime The DateTime the time event was last modified.
createdBy The ID of the person who created the time event.
lastModifiedBy The ID of the person who last modified the time event.
resourceDetailId The globally unique database-level identifier of the resource detail record.
chunkStatus

The status of the time events that are in the same series of paried time event data. Valid values:

Value Description
OK All data in the series is valid
ERROR There is a validation error in at least one item in the the series of paried time events.
messages If the status is SUCCESS, this field is always blank.
count The number of records returned.

Examples

Sample API Call
GET http://company.com/api/v1/pX3459712f8/timeEvents
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=
Sample API Call - Expand Status Details
GET http://company.com/api/v1/pX3459712f8/timeEvents?expand=statusDetail
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=
Sample API Call - Expand Attributes
GET http://company.com/api/v1/pX3459712f8/timeEvents?expand=attributes
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=

Successful Responses

Response Body Sample
{
    "hostId": "62b8c2bf3932e9e50457cce0dbe4f547",
    "status": "SUCCESS",
    "content": [
        {
            "timeEventId": "z21101822235704359570608",
            "timestampType": "START",
            "timestamp": "2021-06-27 08:45:00.000 +0530",
            "timeRecordId": "z2110191749136207353962a",
            "timeEventChunkId": "z21100118340397426541850.DAILY.2021-06-27+0000",
            "rawTimeEventId": null,
            "sourceId": "TPS",
            "status": "VALIDATION_ERROR",
            "syntheticFlag": false,
            "parentTimeEventId": null,
            "timeType": "Work",
            "template": "TimeBundleAutoverificationTemplateWithCombinerRule0009",
            "type": "CLOCK_IN",
            "personId": "z21100118340397426541850",
            "rawTimestamp": "2021-06-27 08:45:00.000 +0530",
            "createdTime": "2021-06-28 22:23:57.897 +0000",
            "lastModifiedTime": "2021-06-29 17:49:14.440 +0000",
            "createdBy": "tenant_admin",
            "lastModifiedBy": "tenant_admin",
            "resourceDetailId": "z21101521380050230939008",
            "chunkStatus": "ERROR"
        }        
    ],
    "messages": [],
    "count": 1
}
Response Body Sample - Expand Status Details
{
    "hostId": "62b8c2bf3932e9e50457cce0dbe4f547",
    "status": "SUCCESS",
    "content": [
        {
            "timeEventId": "z210125193609703880890bf",
            "timestampType": "START",
            "timestamp": "2020-06-05 07:45:00.000 +0000",
            "timeRecordId": "z210125193616617887330bf",
            "timeEventChunkId": "z210125181919519751250bf.DAILY.2020-06-04+0000",
            "rawTimeEventId": null,
            "sourceId": "TPS",
            "status": "PAUSED",
            "statusDetail": [
                {
                    "type": "TPS".
                    "code": "error.lockedTB",
                    "text": "Unable to process as the time bundle is in an invalid status"
            ],
            "syntheticFlag": false,
            "parentTimeEventId": null,
            "timeType": "Work",
            "template": "TE_TO_TB_BusinessRules_No_Default_Mandatory",
            "type": "CLOCK_IN",
            "personId": "z210125181919519751250bf",
            "rawTimestamp": "2020-06-05 07:45:00.000 +0000",
            "createdTime": "2020-06-05 07:46:09.780 +0000",
            "lastModifiedTime": "2020-06-05 07:46:17.173 +0000",
            "createdBy": "z20030311085894036443d2d",
            "lastModifiedBy": "synthetic-person-object",
            "resourceDetailId": "z21101521380050230939008",
            "chunkStatus": "OK"
        },
        {
            "timeEventId": "z210125193615255885660bf",
            "timestampType": "STOP",
            "timestamp": "2020-06-04 16:45:00.000 +0000",
            "timeRecordId": "z210125193616617887330bf",
            "timeEventChunkId": "z210125181919519751250bf.DAILY.2020-06-04+0000",
            "rawTimeEventId": null,
            "sourceId": "TPS",
            "status": "PAUSED",
            "statusDetail": [
                {
                    "type": "TPS".
                    "code": "error.lockedTB",
                    "text": "Unable to process as the time bundle is in an invalid status"
            ],
            "syntheticFlag": false,
            "parentTimeEventId": null,
            "timeType": null,
            "template": "TE_TO_TB_BusinessRules_No_Default_Mandatory",
            "type": "CLOCK_OUT",
            "personId": "z210125181919519751250bf",
            "rawTimestamp": "2020-06-05 16:45:00.000 +0000",
            "createdTime": "2020-06-05 16:56:15.383 +0000",
            "lastModifiedTime": "2020-06-05 16:56:17.240 +0000",
            "createdBy": "z20030311085894036443d2d",
            "lastModifiedBy": "synthetic-person-object",
            "resourceDetailId": "z21101521380050230939008",
            "chunkStatus": "OK"
        }        
    ],
    "messages": [],
    "count": 2
}
Response Body Sample - Expand Attributes
{
    "hostId": "62b8c2bf3932e9e50457cce0dbe4f547",
    "status": "SUCCESS",
    "content": [
        {
            "timeEventId": "z210125193545828875780bf",
            "timestampType": "START",
            "timestamp": "2020-06-04 08:15:00.000 +0000",
            "timeRecordId": "z210125193616606887320bf",
            "timeEventChunkId": "z210125181919519751250bf.DAILY.2020-06-04+0000",
            "rawTimeEventId": null,
            "sourceId": "TPS",
            "status": "PAIRED",
            "syntheticFlag": false,
            "parentTimeEventId": null,
            "timeType": "Work",
            "template": "TE_TO_TB_BusinessRules_No_Default_Mandatory",
            "type": "CLOCK_IN",
            "personId": "z210125181919519751250bf",
            "attributes": {
                "WorkSchedule": "workSchedule[workScheduleId eq 'z210125181918690749200bf'].",
                "CorporateCalendar": "corporateCalendar[corporateCalendarId eq 'z210125181918869749740bf']."
            },
            "rawTimestamp": "2020-06-04 08:15:00.000 +0000",
            "createdTime": "2020-06-04 08:15:45.990 +0000",
            "lastModifiedTime": "2020-06-04 08:16:17.013 +0000",
            "createdBy": "z20030311085894036443d2d",
            "lastModifiedBy": "synthetic-person-object",
            "resourceDetailId": "z21101521380050230939008",
            "chunkStatus": "OK"
        },
        {
            "timeEventId": "z210125193559772877130bf",
            "timestampType": "STOP",
            "timestamp": "2020-06-04 16:45:00.000 +0000",
            "timeRecordId": "z210125193616606887320bf",
            "timeEventChunkId": "z210125181919519751250bf.DAILY.2020-06-04+0000",
            "rawTimeEventId": null,
            "sourceId": "TPS",
            "status": "PAIRED",
            "syntheticFlag": false,
            "parentTimeEventId": null,
            "timeType": null,,
            "template": "TE_TO_TB_BusinessRules_No_Default_Mandatory",
            "type": "CLOCK_OUT",
            "personId": "z210125181919519751250bf",
            "attributes": {
                "WorkSchedule": "workSchedule[workScheduleId eq 'z210125181918690749200bf'].",
                "CorporateCalendar": "corporateCalendar[corporateCalendarId eq 'z210125181918869749740bf']."
            },
            "rawTimestamp": "2020-06-04 16:45:00.000 +0000",
            "createdTime": "2020-06-04 16:45:59.867 +0000",
            "lastModifiedTime": "2020-06-04 16:46:17.097 +0000",
            "createdBy": "z20030311085894036443d2d",
            "lastModifiedBy": "synthetic-person-object",
            "resourceDetailId": "z21101521380050230939008",
            "chunkStatus": "OK"
        }
    ],
    "messages": [],
    "count": 2
}