GET /v2/timeslips filtering by date_from and date_to produces inconsistent results

Hi,

I want to retrieve the timeslips for a user for a specific day. I’m using the from_date and to_date query params to filter the results. However, it is behaving strangely. For example this request:

GET https://api.sandbox.freeagent.com/v2/timeslips?user=https://api.sandbox.freeagent.com/v2/users/{id}?from_date=2024-06-11&to_date=2024-06-11

Returns two timeslips:

<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <timeslips type="array">
    <timeslip>
      ...
      <dated-on type="date">2024-06-11</dated-on>
      ...
    </timeslip>
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
    </timeslip>
  </timeslips>
</freeagent>

I find it strange the entry from the 06-10 is there, and the 06-10 entry is the only entry if I change the URL to:

GET https://api.sandbox.freeagent.com/v2/timeslips?user=https://api.sandbox.freeagent.com/v2/users/{id}?from_date=2024-06-10&to_date=2024-06-10
<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <timeslips type="array">
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
    </timeslip>
  </timeslips>
</freeagent>

However, when the URL is:

GET https://api.sandbox.freeagent.com/v2/timeslips?user=https://api.sandbox.freeagent.com/v2/users/{id}?from_date=2024-06-09&to_date=2024-06-09

the response correctly contains no entries:

<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <timeslips type="array"/>
</freeagent>

Note, the day when I was running these queries was 06-11 which may be affecting results for the first query in this case.

Does anyone know why the entry from 06-10 is included when the filter dates are 06-11?

Thanks,
Dam

Hi there, I’m one of the engineers at FreeAgent, let me look into this for you and I’ll get back to you.

Thanks George. I’ve tested again today and am seeing the same results. I’ve included the created-at and updated-at values in case they are helpful.

GET https://api.sandbox.freeagent.com/v2/timeslips?user=https://api.sandbox.freeagent.com/v2/users/{{id}}?from_date=2024-06-11&to_date=2024-06-11

<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <timeslips type="array">
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
      <updated-at type="dateTime">2024-06-10T21:41:25Z</updated-at>
      <created-at type="dateTime">2024-06-10T21:41:25Z</created-at>
    </timeslip>
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
      <updated-at type="dateTime">2024-06-10T09:16:40Z</updated-at>
      <created-at type="dateTime">2024-06-10T09:16:40Z</created-at>
    </timeslip>
  </timeslips>
</freeagent>

In the last response timeslips for June 10th are returned even though the filtering should limit to June 11th. I subsequently made a request for the same operation with a different user id and got timeslips from two days, one for the 11th and two for the 10th.

https://api.sandbox.freeagent.com/v2/timeslips?user=https://api.sandbox.freeagent.com/v2/users/{{id}}?from_date=2024-06-11&to_date=2024-06-11

<?xml version="1.0" encoding="UTF-8"?>
<freeagent>
  <timeslips type="array">
    <timeslip>
      ...
      <dated-on type="date">2024-06-11</dated-on>
      ...
      <updated-at type="dateTime">2024-06-11T08:58:53Z</updated-at>
      <created-at type="dateTime">2024-06-11T08:58:53Z</created-at>
    </timeslip>
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
      <updated-at type="dateTime">2024-06-11T11:16:07Z</updated-at>
      <created-at type="dateTime">2024-06-11T11:16:07Z</created-at>
    </timeslip>
    <timeslip>
      ...
      <dated-on type="date">2024-06-10</dated-on>
      ...
      <updated-at type="dateTime">2024-06-10T09:44:18Z</updated-at>
      <created-at type="dateTime">2024-06-10T09:44:18Z</created-at>
    </timeslip>
  </timeslips>
</freeagent>

Hi George, have you had a chance to look into this?

Hi there Dam,

Thanks for sharing this - I’m just looking in to this alongside George to help pin down what’s happening for you. In order for us to rule out some potential issues, could you share the company and user IDs which you’re using with the sandbox queries with us please?

I’d also like to rule out any potential timezone difference shenanigans; can you confirm which timezone you’re in?

Thanks

Wil - FreeAgent