Hey guys, i'm encountering unexpected behavior wit...
# api
t
Hey guys, i'm encountering unexpected behavior with several APIs, can someone take a look? Perhaps a couple of these are user error, but it seems like the APIs aren't returning what I expect. 1.
GET <https://api.cal.dev/v1/event-types>
-> returns empty array even though I have a few event types i can see on web 2.
GET <https://api.cal.dev/v1/event-types/151>
-> If I try to get info on a specific event type, the server times out. Sometimes returns a 500. 3.
GET <https://api.cal.dev/v1/availabilities>
-> returns empty array even though I can see Working Hours set up on web 4.
PATCH <https://api.cal.dev/v1/bookings/145>
with body
{"description": "testing description patch"}
-> returns 400
"Something went wrong"
. Same thing happens for all other PATCH APIs I tried. Am I structuring the body wrong? I'm following the format on swagger. 5.
GET <https://api.cal.dev/v1/schedules>
-> returns a 400 with message
"Expected object, received string"
6.
GET <https://api.cal.dev/v1/schedules/3>
-> seems like i can access arbitrary schedules by requesting their IDs. I don't own schedule 3 (it belongs to user 6, i'm user 89) but I can still query it. Thanks for the help!
🙏 1
z
There’s a pending update to launch API to production. Right now it's connected to your staging db. cc @Agusti
t
Yup I'm aware of that, all this was done against app.cal.dev
❤️ 1
a
Thanks Tejas checking right now! Just shipped quite a big merge so let me know if that fixed some of it for you, will be double checking anyway and fix anything that was missing 🙏
t
Appreciate the follow-up, will check on Monday. Have a nice weekend y'all!
a
Likewise nice weekend! See you monday!!
Hello @Tejas Badadare good morning! 1, 2, and 3, 5 and 6 are fixed, thank you so much for such a thorough testing! 4. Indeed swagger docs for patch endpoints is wrong, will update/fix this soon In the meantime, this is an example PATCH in availabilities endpoint
Copy code
## Edit or update an existing availability
curl -X "PATCH" "<http://localhost:3002/v1/availabilities/25?apiKey=cal_9499ac8c93409441b49b3e237795b662>" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "days": [
    1,
    2,
    3,
    4,
    5
  ],
  "eventTypeId": 2
}'
🙏 1
t
Thanks for the follow-up up! Unfortunately I'm still seeing 1, 3, 4 on staging. I'm trying to use the API to read and edit a booking's location field. Currently I can do neither - the location field just shows up as "integrationsgooglemeet" in both the API and webhook. Can you let me know how to get the actual meet URL, and how to programatically replace it with another URL?
🙏 1