[CAL-4969] Unable to get slots by event type slug
Found a bug? Please fill out the sections below. 👍
Issue Summary
I'm using https://api.cal.com/v2/slots/available api to fetch available slots.
When I run this query with eventTypeId I get the slots:
Following works
GET
https://api.cal.com/v2/slots/available?startTime=2025-01-03T21:33:24.452Z&endTime=2025-01-06T21:33:24.452Z&eventTypeId=1568235
However when I use the slug of same event I get error
GET
https://api.cal.com/v2/slots/available?startTime=2025-01-03T21:33:24.452Z&endTime=2025-01-06T21:33:24.452Z&eventTypeSlug=15min
Error 404 - Not found
{
"status": "error",
"timestamp": "2024-12-27T23:06:58.984Z",
"path": "/v2/slots/available?startTime=2025-01-03T21%3A33%3A24.452Z&endTime=2025-01-06T21%3A33%3A24.452Z&eventTypeSlug=15min",
"error": {
"code": "TRPCError",
"message": "NOT_FOUND"
}
}
Steps to Reproduce
- Get API ky from cal.com dashboard
- Get your event types using: https://api.cal.com/v2/event-types
- Get slots using https://api.cal.com/v2/slots/available?startTime=2025-01-03T21:33:24.452Z&endTime=2025-01-06T21:33:24.452Z&eventTypeId=<one_of_your_event_id> -> works
- Get slots using https://api.cal.com/v2/slots/available?startTime=2025-01-03T21:33:24.452Z&endTime=2025-01-06T21:33:24.452Z&eventTypeSlug=<slug_for_same_event> -> errors
Actual Results
- Querying by slug should errors out
Expected Results
- Querying by slug should respond in slots
Technical details
- APIs called using latest postman
Hi @edishu
If you’re using eventTypeSlug instead of eventTypeId, make sure to include the usernameList parameter as well. Without it, the API won’t be able to determine which user the event type slug corresponds to. You can find more details about the usernameList parameter in the API v2 documentation.
Just wanna let you know that, I'm working on it
Sorry to ping but wanna ask the requirement for the issue is that "User should be able to fetch slots available based of eventTypeSlug without username"?
@jj10133 Yes that is correct just like eventTypeId I should be able to fetch slots using eventTypeSlug. Username information should not be required because that information is encoded in API key which is passed with the request.
cc @JDP-Neo