createdAtLt and createdAtLt not working
# support
h
When I call https://api.vapi.ai/call, and I want to only select the calls made on a certain day, and I add the following payload, the API still returns all of the calls rather than the calls made during a certain time range. Any ideas how I can fix this? { "createdAtLt": "2024-12-28T19:51:18.894Z" }
v
@huiwang To filter the calls made on a certain day, you need to specify both a start and end time for your query to define the range of the entire day. The
createdAtLt
(created at less than) parameter you've used will only filter calls made before the specified timestamp. To get calls from a specific day, you should use both
createdAtGte
(created at greater than or equal to) and
createdAtLt
parameters to encompass the 24-hour period. Here's an example payload to get calls from a specific day (let's say December 27, 2024):
Copy code
json
{
    "createdAtGte": "2024-12-27T00:00:00Z",
    "createdAtLt": "2024-12-28T00:00:00Z"
}
This will return calls that were created on December 27, 2024. Make sure to adjust the dates to the day you're interested in. If you're still encountering issues after using both parameters correctly, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
h
I tried add these date ranges but the API is still returning everything. I need only phone calls of a certain date.
Oh I found where the problem was. I was stipulating these ranges through attaching a payload, when the right way to resolve this is through adding params. Once I did the latter, the API behaves as expected.
2 Views