Filter by date

There are two timestamp fields in all endpoints to facilitate the identification of a change to the data set. For example, recently created or updated entities. These are CreatedOn and LastModifiedOn.

Over the course of the 2024, we plan to introduce two more timestamp fields, SourceSystemCreatedOn and SourceSystemLastModifiedOn.

Definitions

  • CreatedOn - this is when the IRIS HR API creates the entity.

  • SourceSystemCreatedOn - this is when the source system database creates the entity, for example, Cascade.

  • LastModifiedOn - this is when the entity was last changed. This field is the same as the CreatedOn field, providing the entity has not changed since creation.

  • SourceSystemLastModifedOn - when the entity has changed in the source system database, for example, Cascade.

All of these fields are in the format of ODATA EDM.DateTimeOffset and support binary comparison, such as 'lt', 'gt', 'ge', 'le', 'eq' and 'ne'.

Here are some examples of how to use this filter on the Absence endpoint.

  1. Get absence entity created after Nov 1st, 2023.

    Copy
    https://api.iris.co.uk/hr/v2/attendance/absences?$filter=CreatedOn gt 2023-11-01T00:00:00Z
  2. Get absence entity created after 2pm Nov 1st, 2023

    Copy
    https://api.iris.co.uk/hr/v2/attendance/absences?$filter=CreatedOn gt 2023-11-01T14:00:00Z
  3. Get absence entity created between Nov 1st, 2023 and Dec 1st, 2023.

    Copy
    https://api.iris.co.uk/hr/v2/attendance/absences?$filter=CreatedOn gt 2023-11-01T00:00:00Z and CreatedOn lt 2023-12-01T00:00:00Z
  4. Get absence entity created on the day of Nov 1st, 2023.

    Copy
    https://api.iris.co.uk/hr/v2/attendance/absences?$filter=CreatedOn gt 2023-11-01T00:00:00Z and CreatedOn lt 2023-11-01T23:59:59Z
  5. Get absence entity modified after Nov 1st, 2023. These entities need changing after creation.

    Copy
    https://api.iris.co.uk/hr/v2/attendance/absences?$filter=LastModifiedOn gt 2023-11-01T00:00:00Z and CreatedOn ne LastModifiedOn

    There is no single quote mark around timestamp strings in the ODATA query.