Hello, guys! I started to integrate <cal.com> API ...
# api
a
Hello, guys! I started to integrate cal.com API into my server app and faced with 2 issues. 1. I can not make any API call to cal.com backend using my API keys. I tried api.cal.com and api.cal.dev with test and live API keys but always getting same error
Copy code
curl -X 'GET' \
  '<https://api.cal.dev/bookings?apiKey=cal_test_d...3>' \
  -H 'accept: */*'
{"message":"Something went wrong","error":{"clientVersion":"3.10.0"}}
2. In swagger doc I found https://developer.cal.com/api/api-reference https://api.cal.com/docs there is no definition of request body of POST and PUT requests? Is it broken? When it will be fixed?
a
Hello @Alexey Pepeskul thanks for reporting,Im indeed still working on pushing updated swagger docs for patch/post operations, will ping you here once available
a
@Agusti thx for quick response. How about 1st question?
2
a
I’m getting the same error when I try to call the
event-types
endpoint. Trying to follow the step in Quick Start to get set up.
Still getting the “Something went wrong” error
🙏 1
a
Will look into it now and report back @Adam Bauman
🙏 1
a
FWIW I’ve also tried this against https://api.cal.dev/event-types with my dev key and seeing the same error.
v
Hi @Agusti, @Adam Bauman, @Alexey Pepeskul, was there a resolution to the "Something went wrong error"? I am also running into it when curl'ing
<https://api.cal.com/v1/event-types?apiKey=cal_****>
Hi @Agusti, @Adam Bauman, @Alexey Pepeskul, was there a resolution to the "Something went wrong" error when making an API call to the cal.com backend? I am also running into it when curl'ing
<https://api.cal.com/v1/event-types?apiKey=cal_****>
. Just for context, I created my account yesterday (5/13). @Agusti, happy to share my account info in a DM if that would be helpful.
m
I also signed up recently (5/14) and am running into this same issue. Curl request to v1/event-types + many other URLs returns "Something went wrong". Hopefully this is just something we're overlooking.
1
e
I’m also running into the same issue, I thought it was me doing something wrong, but it appears that it’s the API
It’s also my first time using the API, and I see that on the documentation it says the key should start either with
cal_test_
or
cal_live_
, but mine starts with
cal_a***
, is that alright? Or should I be doing something different?
a
I’m seeing the same format of my API keys @Elias Ruiz Monserrat
m
Hey folks, (1) just got an email from support that public API is only being offered to Enterprise plans but will soon be available to both hosted Pro and self hosted. Also, (2) my API keys don't match the cal_test / cal_live either. Maybe the docs will be updated soon to reflect both points. Hopefully soon comes soon 🙂 Really looking forward to programming time!
1
v
thanks for sharing @Matthew Larkin re: public API only being offered to enterprise plans. I was not aware of that. Very much hoping that the public API will be available to Pro plans as well.
@Agusti are you able to share a timeline on the above?
a
@Varun Krishnamurthy API should be available to hosted pro users next this week, hopefully tomorrow or wednesday Working on that! Almost ready.
❤️ 1
v
thanks @Agusti. looking forward to using the API! can you also share some context on @Matthew Larkin’s point about API keys? At least on the hosted Pro plan, I only have 1
cal_***
key, as opposed to
cal_live_***
and
cal_test_***
keys. Is that expected?
a
Yes that’s a known issue, I’m not changing the PREFIX env variable to cal_live until database is actually prod and connects to live. Will give a notice here once it’s ready, but yeah once we ship keys will be cal_live_
v
got it, thanks @Agusti. looking forward to tomorrow/Wednesday 😄
❤️ 1
hi @Agusti, any update here re: API being available for self hosted Pro plans? 🙂
a
@Varun Krishnamurthy Yes, it actually already is! Announcing very soon, stay tuned at #admin-panel-and-api
v
got it! I'm excited. one thing I notice now @Agusti - when I try CURLing as such:
Copy code
<https://api.cal.com/v1/event-types?apiKey=cal_****>
I now get a
Copy code
{
  "error": "Your apiKey is not valid"
}
Is that expected?
a
Can you either generate a new api key (should be cal_live_) or try with your current one but modifying to cal_live_?
and actually Im working right now on a fix on event-types, so maybe you’ll get some zod validation errors there once you have a valid apiKey, fix coming soon
v
ah, yea, I'm getting:
Copy code
varun.krishnamurthy@Varuns-MBP dawn-backend % curl '<https://api.cal.com/v1/event-types?apiKey=cal_live_***>'
{"message":"Something went wrong","error":{"issues":[{"code":"invalid_union","unionErrors":[{"issues":[{"code":"invalid_union","unionErrors":[{"issues":[{"code":"invalid_type","expected":"string","received":"null","path":["metadata"],"message":"Expected string, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"number","received":"null","path":["metadata"],"message":"Expected number, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"boolean","received":"null","path":["metadata"],"message":"Expected boolean, received null"}],"name":"ZodError"}],"path":["metadata"],"message":"Invalid input"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"array","received":"null","path":["metadata"],"message":"Expected array, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"object","received":"null","path":["metadata"],"message":"Expected object, received null"}],"name":"ZodError"}],"path":["metadata"],"message":"Invalid input"}],"name":"ZodError"}}%               varun.krishnamurthy@Varuns-MBP dawn-backend % curl '<https://api.cal.com/v1/event-types?apiKey=cal_live_50cebc04c800a7fc6e04a504e452dafa>'
{"message":"Something went wrong","error":{"issues":[{"code":"invalid_union","unionErrors":[{"issues":[{"code":"invalid_union","unionErrors":[{"issues":[{"code":"invalid_type","expected":"string","received":"null","path":["metadata"],"message":"Expected string, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"number","received":"null","path":["metadata"],"message":"Expected number, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"boolean","received":"null","path":["metadata"],"message":"Expected boolean, received null"}],"name":"ZodError"}],"path":["metadata"],"message":"Invalid input"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"array","received":"null","path":["metadata"],"message":"Expected array, received null"}],"name":"ZodError"},{"issues":[{"code":"invalid_type","expected":"object","received":"null","path":["metadata"],"message":"Expected object, received null"}],"name":"ZodError"}],"path":["metadata"],"message":"Invalid input"}],"name":"ZodError"}}
a
Yup that’s the one! Working on the fix right now but your api key works 😉
v
great thanks @Agusti. please let me know once the fix is out in production, and I will try again 🙂
👍 1
a
Also will add a fallback for cal_ keys as many users might have alrady generated them like so PS: Since it’s a few users that will have only generated api keys for now, we will not accept cal_ and tell them to replace manually for cal_live_
👍 2