SAP Knowledge Base Article - Public

3559302 - Absence Data Not Retrieved in SuccessFactors Timeoff API Call

Symptom

  • The "/rest/timemanagement/absence/v1/events" API is used to fetch data for upcoming absences, holidays, and non-working days for employees. Only PUBLIC_HOLIDAY and NON_WORKING_DAY data are being fetched, ABSENCE data is not retrieved despite the employee having multiple absences during the query period.
  • Only the top 10 records are being fetched by the API.

Disclaimer: Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
    • API & Adhoc API Framework
      • REST API

Reproducing the Issue

  1. Run the API query: https:/<api-url>/rest/timemanagement/absence/v1/events?assignmentId=*****&types=ABSENCE,PUBLIC_HOLIDAY,NON_WORKING_DAY&startDate=2024-01-01&endDate=2024-12-31
  2. Only the top 10 records are visible, although there are more than 10 records.

Cause

Without the $top parameter, by default, the object will fetch only the top 10 records.

Resolution

  1. To fetch more than 10 records, use the $top parameter.
    Eg: https:/<api-url>/rest/timemanagement/absence/v1/events?assignmentId=******&types=ABSENCE,PUBLIC_HOLIDAY,NON_WORKING_DAY&startDate=2024-01-01&endDate=2024-12-31&$top=50 
  2. In one API call, a maximum top 50 records can be fetched.
  3. To fetch the next 50 events, make use of the $skip parameter, for example, $top=50&$skip=50 (to fetch records between 50-100) and so on.

See Also

REST API: Upcoming Time Off, Holidays, and Non-Working Days | SAP Help Portal

Keywords

SuccessFactors, Timeoff, API, ABSENCE, PUBLIC_HOLIDAY, NON_WORKING_DAY, $top parameter, $skip parameter, fetch records, REST API, Upcoming Time Off, Holidays, Non-Working Days, maximum 10 records.  , KBA , LOD-SF-INT-API , API & Adhoc API Framework , Problem

Product

SAP SuccessFactors HCM Core 2511 ; SAP SuccessFactors HCM Suite 2511