Hi, again. I'm having trouble with the /event-type...
# api
d
Hi, again. I'm having trouble with the /event-types endpoint, trying to integrate cal.com with our platform, hopefully someone here is able to help us: When a user has succesfully registered, we programatically (via api.cal.com) 1. create a team for the new user 2. create two schedules for the team 3. create two event types for the team (1 per schedule) 4. create two availabilities for the team (1 per schedule/event type) However, when we create the event type(s) via API, we have the following issues: • we can't schedule events through the booking calendar (https://cal.com/{teamSlug}/{eventTypeSlug}), the "days" are just greyed-out • on app.cal.com/event-types the new team, availabilities and event types are visible, but: ◦ the newly created event types appear below the newly created team (correct), but also below the "global" user at the very top (might indicate the root cause of the issue?) ◦ the event types are not editable, when trying to edit them through app.cal.com we get an error 500 (everything else newly created is editable and appears fine) ◦ the created event types also don't show up when calling https://api.cal.com/v1/event-types/?apiKey=… we started out with this POST body to /event-types:
Copy code
{
	length: 15,
	title: 'some title',
	slug: 'some-title',
	description: '',
	metadata: {},
	teamId: 1234,
}
but a more sophisticated POST body results in the same issues:
Copy code
{
  "title": "EventType Per Postman",
  "slug": "eventtype-per-postman",
  "description": "",
  "position": 0,
  "locations": [
    {
      "type": "integrations:daily"
    }
  ],
  "length": 15,
  "hidden": false,
  "userId": null,
  "teamId": 1234,
  "eventName": "",
  "timeZone": null,
  "periodType": "UNLIMITED",
  "periodDays": null,
  "periodCountCalendarDays": false,
  "requiresConfirmation": false,
  "disableGuests": false,
  "hideCalendarNotes": false,
  "minimumBookingNotice": 120,
  "beforeEventBuffer": 0,
  "afterEventBuffer": 0,
  "schedulingType": "COLLECTIVE",
  "price": 0,
  "currency": "usd",
  "slotInterval": null,
  "metadata": {
    "blockchainId": 1
  },
  "successRedirectUrl": null
}
Note: the
seatsPerTimeSlot
and
scheduleId
properties are not recognised, also
"periodStartDate": "2022-09-27T09:41:32.794Z"
and
"periodEndDate": "2022-09-27T09:41:32.794Z"
result in the error
"Expected date, received string"
z
cc @Agusti any pointers?
d
no one who can help?
a
@Damian Kress I will try to fix it later today
It seems a missing validation schema for those fields, will add
Will ping you once its fixed, thanks for reporting
d
awesome, thanks 🙏 could you also please briefly explain how the
"preiodStartDate"
and
"periodEndDate"
fields are meant to be used? I can't find any documentation on them
r
hey @Agusti was the issue fixed to see the event types of teams? I'm trying doing the same but I can't find the team events when calling event-types