Get Specified Time Event

Return a specific time event object for the specified tenant.

Command

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

Parameters

Name Required Data Type Description Parameter Type
tenantId Yes String Unique identifier of the tenant. Path
id Yes String Unique identifier of the time event. Path

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. Valid values:

  • SUCCESS - The operation was a success.
  • ERROR - A validation error occurred.
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. If the status is ERROR, a validation error occurred. For example, the time event ID in the URL is invalid.
count The number of records returned.

Examples

Sample API Call
GET http://company.com/api/v1/pX3459712f8/timeEvents/z20051220374253690192cca
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=

Successful Responses

Response Body Sample
{
    "hostId": "1c0a7eab876a94ed104627933178f064",
    "status": "SUCCESS",
    "perfs": {
        "count": 1,
        "duration": 53,
        "sqlDuration": 23,
        "sqlCount": 12,
        "ruleDuration": 0,
        "ruleCount": 0,
        "methodCount": 0,
        "methodDuration": 0,
        "sqlPerfs": null,
        "methodPerfs": null,
        "duplicates": null
    },
    "content": {
        "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": "PAIRED",
        "statusDetail": [],
        "syntheticFlag": false,
        "parentTimeEventId": null,
        "timeType": null,
        "template": "TE_TO_TB_BusinessRules_No_Default_Mandatory",
        "type": "CLOCK_OUT",
        "personId": "z210125181919519751250bf",
        "attributes": {
            "WorkSchedule": "workSchedule[workScheduleId eq 'z21100117235568525021105'].",
            "CorporateCalendar": "corporateCalendar[corporateCalendarId eq 'z21100117235582624017850']."
        },
        "rawTimestamp": "2020-06-04 16:45:00.000 +0000",
        "createdTime": "2020-06-04 16:46:15.383 +0000",
        "lastModifiedTime": "2020-06-04 16:46:17.240 +0000",
        "createdBy": "z20030311085894036443d2d",
        "lastModifiedBy": "synthetic-person-object",
        "resourceDetailId": "z21101521380050230939008",
        "chunkStatus": "OK"
    },
    "messages": [],
    "count": 1
}

Error Responses

Response Body Sample Error - Invalid Time Event ID in URL
{
    "hostId": "a5101d932c370bf3e36da6b7bafb0aab",
    "status": "ERROR",
    "content": null,
    "messages": [
        {
            "type": "ERROR",
            "message": "Failed to Load Resource of Type TimeEvent with Arguments [z20040717473911feg075486154]",
            "code": "error.resourceNotFound",
            "arguments": {
                "type": "TimeEvent",
                "id": "z20040717473911feg075486154"
            },
            "key": "TimeEvent"
        }
    ],
    "count": -1
}