Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get slots by event type slug #18396

Open
edishu opened this issue Dec 27, 2024 · 1 comment
Open

Unable to get slots by event type slug #18396

edishu opened this issue Dec 27, 2024 · 1 comment
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working

Comments

@edishu
Copy link

edishu commented Dec 27, 2024

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
@edishu edishu added the 🐛 bug Something isn't working label Dec 27, 2024
@dosubot dosubot bot added the api area: API, enterprise API, access token, OAuth label Dec 27, 2024
@kart1ka
Copy link
Contributor

kart1ka commented Dec 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants