Hi Personians,
Did anyone face the problem with mixed up values returned by Absence API?
The endpoint we are using is: /company/time-offs
let responseAbsences = UrlFetchApp.fetch('https://api.personio.de/v1/company/time-offs?updated_from=' + reportStartDate + '&updated_to=' + reportEndDate, getAuthOptions());
Code used for packaging up the rows is similar to this:
requestedFields.forEach(function (field) {
switch (field) {
case 'created_at':
return row.push(absence.attributes.created_at.substring(0,10));
case 'start_date':
return row.push(absence.attributes.start_date.substring(0,10));
case 'end_date':
return row.push(absence.attributes.end_date.substring(0,10));
case 'days_count':
return row.push(absence.attributes.days_count);
case 'time_off_type':
return row.push(absence.attributes.time_off_type.attributes.name);
case 'comment':
return row.push(absence.attributes.comment);
case 'time_off_category':
return row.push(absence.attributes.time_off_type.attributes.category);
case 'employee':
return row.push(absence.attributes.employee.attributes.first_name.value + " " + absence.attributes.employee.attributes.last_name.value);
case 'email':
return row.push(absence.attributes.employee.attributes.email.value);
case 'status':
return row.push(absence.attributes.status);
case 'created_by':
return row.push(absence.attributes.created_by);
default:
return row.push('');
}
The issue we are facing is that created_by is in majority of the cases the name of some other employee (who didn't have anything to do with reporting this person's absence). Typically, it's a mix up of people who did report absences during the same day, but as if it's shifted by 1 or two rows (e.g. out of 6 people that reported absence by 9 AM this morning, for 5 of them Created By filed had value which was pointing to name of the other person that reported the absence that morning too, but not themselves).
Also, Days Count is sometimes exact and sometimes much bigger than it should be (e.g. person is taking one day off, and days count shows 4).
Any idea what might be going on here?
Thank you and have a great day,
Vida