cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

[CAL-4969] Unable to get slots by event type slug

Open edishu opened this issue 1 year ago • 1 comments

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

  1. Get API ky from cal.com dashboard
  2. Get your event types using: https://api.cal.com/v2/event-types
  3. 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
  4. 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

CAL-4969

edishu avatar Dec 27 '24 23:12 edishu

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.

kart1ka avatar Dec 29 '24 07:12 kart1ka

Just wanna let you know that, I'm working on it

jj10133 avatar Apr 27 '25 01:04 jj10133

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 avatar Apr 29 '25 20:04 jj10133

@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.

edishu avatar May 03 '25 17:05 edishu

cc @JDP-Neo

CarinaWolli avatar Oct 17 '25 09:10 CarinaWolli