calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
32.63k stars 8.08k forks source link

Issue with Slot Availability API (Time Range and Missing Slots) #17844

Open adib123x opened 4 days ago

adib123x commented 4 days ago

I am trying to send a query from make.com to cal.com in order to check an availability for a desired/specified date. I am doing this through quering a HTTP make a request in make.com. Attached is a screenshot of an example query to check the availability for the 25th November. When sending this query, the expected result is that the returned available slots would be 9am-5pm, as these are the available hours in my calendar.

Screenshot 2024-11-25 at 12 20 58 am

However, when querying availability using the endpoint https://api.cal.com/v1/slots, the returned slots:

  1. Exclude the first two hours of availability on the requested start date ( 9 AM and 10 AM).
  2. Include slots from the following day that should not appear within the specified range. Here’s an example of the query I used in make.com HTTP make a request: [https://api.cal.com/v1/slots?eventTypeId=1309022&startTime=2024-11-25&endTime=2024-11-26&timeZone=Australia%2FSydney&apiKey=<my-api-key]

and this is the response i am getting: { "slots": { "2024-11-26": [ {"time": "2024-11-26T11:00:00+11:00"}, {"time": "2024-11-26T12:00:00+11:00"}, {"time": "2024-11-26T13:00:00+11:00"}, {"time": "2024-11-26T14:00:00+11:00"}, {"time": "2024-11-26T15:00:00+11:00"}, {"time": "2024-11-26T16:00:00+11:00"} ], "2024-11-27": [ {"time": "2024-11-27T09:00:00+11:00"} ] } }

This output incorrectly omits slots for 2024-11-25 (the requested day) and shows times from subsequent days instead. In the output, the slots available are always missing the first 2 working hours of the day which are available in my calendar (9am and 10am), the slots outputted also include times for the following day which isn't supposed to happen. I have verified the following: The timeZone parameter is correctly passed as Australia/Sydney. My event type configuration (ID: 1309022) is set with no buffers and a minimumBookingNotice of 4 minutes. My Cal.com account time zone is also configured as Australia/Sydney.

Could you please review this behavior? I’d like to understand: Why the requested day’s slots are not appearing correctly. Whether this is related to time zone handling, a configuration issue, or a potential bug in the API.

milospuac commented 4 days ago

@keithwillcode who can quickly look at this one?

keithwillcode commented 4 days ago

@keithwillcode who can quickly look at this one?

@ThyMinimalDev @supalarry

adib123x commented 2 days ago

Hi @keithwillcode , any updates?