Get All Time Bundle Versions

Returns a list of time bundle versions for the specified tenant.

Command

GET https://{server}/api/v1/{tenantId}/timeBundles/{id}/versions

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 bundle.

Path

expand

No

String

Adds additional detail to the output. Valid options:

  • statusDetail

  • timeBundleLineItems

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

timeRecords?expand=timeBundleLineItems,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:

  • timeBundleRef

  • timeBundleChunkId

  • timeTemplateId

  • template

  • editStatus

  • personId

  • tenantId

  • lobExternalId

  • startDate

  • createdBy

  • createdTime

  • lastModifiedBy

  • lastModifiedTime

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:

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

  • SUCCESS - The operation was a success.

  • ERROR - A validation error occurred.

content

Returns an array of records.

Field

Description

timeBundleRef

The globally unique database-level identifier of the time bundle.

timeTemplateId

The globally unique database-level identifier of the time template specified by the time record.

timeBundleChunkId

Identifies the rule, person, frequency, and date associated with the time bundle.

totalHours

The total number of hours of the time bundle.

sourceId

The applicationName of the apiKeys endpoint.

bundleFrequency

The time period during which data was collected.

status

The status of the time record. 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 bundle is missing one or more required attributes. 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.

Only visible when ?expand=statusDetail is included in the URI.Returns a list of line items for the specified time bundle.

tenantId

The ID of the tenant.

startDate

The start date for items in the time bundle.

lobExternalId

The external line-of-business ID.

personId

The globally unique database-level identifier of the person.

template

The name of the template associated with the time record.

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.

version

The version of the record.

editStatus

The entity that last edited the record, either SYSTEM for records generated from the rules or USER for records that have been edited manually.

timeBundleLineItems

An array of time bundle lineitem records.

Field

Description

timeBundleLineItemRef

The globally unique database-level identifier of the time bundle line item.

chunkId

Identifies the rule, person, frequency, and date associated with the time bundle.

hours

The number of hours for the line item.

value

Stores non-hour related information about the line item. For example, per diem.

frequency

The frequency that data for the line item is collected.

originalLineItemVersionId

If a line item was split, this value is the ID of the original line item.

ruleDefnId

The globally unique database-level identifier of the rule definition.

sourceAction

The action that created the line item. For example, it indicates if the line item is the result of a split or if it was edited or added by a user. Valid values are defined in the LineItemSourceAction Enumerations endpoint.

date

The date the line item was created.

attributes

An array of time bundle attributes defined in the time template.

Key

Value

<attribute name>

The value of the attribute.

Only visible when ?expand=timeBundleLineItems is included in the URI.Returns a list of line items for the specified time bundle.

chunkStatus

The status of the entire group of time data. Any record within the time bundle that has an error, for example, missing a required attribute, will trigger a chunkStatus error. The entire group of records can't complete processing unless all elements in the group pass validation.

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 time recods.

messages

If the status is SUCCESS, this field is always blank. If the status is ERROR, a validation error occurred. For example, the time bundle ID in the URL is invalid.

count

The number of records returned.

Examples

Sample API Call

GET https://tps-api.cfapps.sap.hana.ondemand.com/api/v1/pX2f8122a19/timeBundles/z21102618042048126636012/versions
X-Application-Key: 30b5f27a684744116537882dda0e50efb8c5a6e26a7b7ad2f3fcb2c24436a840
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHB=

Successful Responses

Response Body Sample

{
    "hostId": "b473cba520ad6b57c9ca9153da135c58",
    "status": "SUCCESS",
    "content": [
        {
            "timeBundleRef": "z21102618042048126636012",
            "timeTemplateId": "z21102518593527596892010",
            "timeBundleChunkId": "z211025185332617032112bf.DAILY.2021-02-27+0000",
            "totalHours": 9.2500000000,
            "sourceId": "TPS",
            "bundleFrequency": "DAILY",
            "status": "PENDING_ATTRIBUTE",
            "tenantId": "pX2f8122a19",
            "startDate": "2021-02-27",
            "lobExternalId": "C2039600",
            "personId": "z211025185332617032112bf",
            "template": "TimeBundleAutoverificationTemplateWithCombinerRule0009",
            "createdTime": "2021-10-26 18:04:20.643 +0000",
            "lastModifiedTime": "2021-10-26 18:31:11.900 +0000",
            "createdBy": "tenant_admin",
            "lastModifiedBy": "tenant_admin",
            "version": 0,
            "editStatus": "SYSTEM_GENERATED",
            "chunkStatus": "ERROR"
        },
        {
            "timeBundleRef": "z21102618042048126636012",
            "timeTemplateId": "z21102518593527596892010",
            "timeBundleChunkId": "z211025185332617032112bf.DAILY.2021-02-27+0000",
            "totalHours": 9.2500000000,
            "sourceId": "TPS",
            "bundleFrequency": "DAILY",
            "status": "VALIDATION_ERROR",
            "tenantId": "pX2f8122a19",
            "startDate": "2021-02-27",
            "lobExternalId": "C2039600",
            "personId": "z211025185332617032112bf",
            "template": "TimeBundleAutoverificationTemplateWithCombinerRule0009",
            "createdTime": "2021-10-27 22:16:38.490 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "version": 1,
            "editStatus": "USER_EDITED",
            "chunkStatus": "ERROR"
        },
            "timeBundleRef": "z21102618042048126636012",
            "timeTemplateId": "z21102518593527596892010",
            "timeBundleChunkId": "z211025185332617032112bf.DAILY.2021-02-27+0000",
            "totalHours": 9.2500000000,
            "sourceId": "TPS",
            "bundleFrequency": "DAILY",
            "status": "CREATED",
            "tenantId": "pX2f8122a19",
            "startDate": "2021-02-27",
            "lobExternalId": "C2039600",
            "personId": "z211025185332617032112bf",
            "template": "TimeBundleAutoverificationTemplateWithCombinerRule0009",
            "createdTime": "2021-10-27 22:29:38.560 +0000",
            "lastModifiedTime": null,
            "createdBy": "tenant_admin",
            "lastModifiedBy": null,
            "version": 2,
            "editStatus": "USER_EDITED",
            "chunkStatus": "OK"
        }
    ],
    "messages": [],
    "count": 3
}

Error Responses

Response Body Error Sample - Time Bundle ID in URL is Invalid

{
    "hostId": "4005c0068e886de442067ac16fa178c0",
    "status": "ERROR",
    "content": null,
    "messages": [
        {
            "type": "ERROR",
            "message": "Failed to load resource of type TimeBundle with Arguments [z20080415070308965427c0].",
            "code": "error.resourceNotFound",
            "arguments": {
                "type": "TimeBundle",
                "id": "z20080415070308965427c0"
            },
            "key": "TimeBundle"
        }
    ],
    "count": -1
}