calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
31.06k stars 7.47k forks source link

[CAL-3742] smsReminderNumber throws error #15030

Open GeneralKugelBlitz opened 3 months ago

GeneralKugelBlitz commented 3 months ago

Issue Summary

Using smsReminderNumber throws error

{
  "message": "Legacy Props: smsReminderNumber. They can't be used with `responses`"
}

Steps to Reproduce:

Please use this curl to reproduce.

curl -X POST https://api.cal.com/v1/bookings?apiKey={apikey} \ -H "Content-Type: application/json" \ -d '{ "eventTypeId": 4, "start": "2024-05-17T14:00:00-04:00", "responses": { "name": "John", "email": "sean@cal.com", "location": "Calcom HQ" }, "metadata": { "phone": "+1234334235" }, "timeZone": "America/Chicago", "language": "en", "title": "Debug - sean", "description": "bdcbdib", "smsReminderNumber": "+14159076135" }'

CAL-3742

dosubot[bot] commented 3 months ago

The error you're encountering is because smsReminderNumber is considered a legacy property and cannot be used together with the responses field in your API request to Cal.com. To fix this issue, you should either remove the smsReminderNumber from your request when using responses or avoid using responses if you need to include legacy properties like smsReminderNumber.

The smsReminderNumber is intended for sending SMS reminders and should be handled differently with the new API structure. If you're looking to include SMS reminder functionality with the responses field, the system now looks for an attendee match based on the email provided in responses for sending SMS reminders, rather than directly using smsReminderNumber.

For more detailed handling of SMS reminders with the new API structure, you might need to adjust your implementation to align with how Cal.com now processes booking data and attendee information for SMS reminders.

#### Details **Sources** - [packages/features/bookings/lib/getBookingDataSchemaForApi.ts](https://github.com/calcom/cal.com/blob/main/packages/features/bookings/lib/getBookingDataSchemaForApi.ts) - [packages/features/bookings/lib/getBookingFields.ts](https://github.com/calcom/cal.com/blob/main/packages/features/bookings/lib/getBookingFields.ts) - [packages/prisma/zod-utils.ts](https://github.com/calcom/cal.com/blob/main/packages/prisma/zod-utils.ts) - [packages/features/bookings/lib/getCalEventResponses.ts](https://github.com/calcom/cal.com/blob/main/packages/features/bookings/lib/getCalEventResponses.ts) - [packages/features/ee/workflows/lib/reminders/smsReminderManager.ts](https://github.com/calcom/cal.com/blob/main/packages/features/ee/workflows/lib/reminders/smsReminderManager.ts) - [packages/features/bookings/lib/getBookingResponsesSchema.ts](https://github.com/calcom/cal.com/blob/main/packages/features/bookings/lib/getBookingResponsesSchema.ts) - [apps/api/v1/pages/api/bookings/_post.ts](https://github.com/calcom/cal.com/blob/main/apps/api/v1/pages/api/bookings/_post.ts)
**About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

GeneralKugelBlitz commented 3 months ago

then please change your api reference to show these changes and explain how to add attendees with phone numbers etc. Thanks