xero-node
xero-node copied to clipboard
Using ifModifiedSince with getLeaveApplicationsV2 causes an error
SDK:
- Version 4.35.0
Describe the bug
If you use the ifModifiedSince
argument with the xero.payrollAUApi.getLeaveApplicationsV2
method you'll get a 500 error back.
To Reproduce
Steps to reproduce the behavior:
- Set-up a client and connect it to a Xero tenant that's using AU payroll.
- Try to retrieve the leave applications using the
getLeaveApplicationsV2
method by passing both axeroTenantId
argument and any date for aifModifiedSince
argument.
Alternatively, you can see the underlying issue by doing a cURL request with the If-Modified-Since
header included:
curl 'https://api.xero.com/payroll.xro/1.0/LeaveApplications/v2?page=1' --header 'Xero-Tenant-Id: {ID}' --header 'Accept: application/json' --header 'Authorization: Bearer {TOKEN}' --header 'If-Modified-Since: 2023-07-05T07:43:38.820Z'
You'll get this response back:
{"Title":"An error occurred","Detail":"An error occurred in Xero. Check the API Status page http://status.developer.xero.com for current service status.","Status":500,"Instance":"c1ba9d6b-f0c7-4109-9364-ffdb6744909e"}
Expected behavior
It should accept the header and return only the leave applications modified since the given date as documented here:
https://developer.xero.com/documentation/api/payrollau/leaveapplications#optional-parameters
Screenshots
N/A
Additional context
N/A