Create booking via API with specific duration

Hello guys,
I would like to know how to specify duration when making booking via API.
Thanks in advance for your support.

Request:

{

“timeZone”: “US/Central”,

“startsAt”: “2022-06-14T09:00:00”,

“units”: 1,

“numberOfSlots”: 1,

“answers”: [

{

“code”: “EMAIL”,

“string”: “test-2@testmail.com

},

{

“code”: “FNAME”,

“string”: “test”

},

{

“code”: “LNAME”,

“string”: “test”

}

]

}

Response:

{
“code”: “ycbm_api_booking_invalid_duration_too_short”,
“message”: “Booking duration is shorter than required”,
“type”: “YcbmApiException”,
“errors”: ,
“httpCode”: 400
}

@edouard welcome to the Forum!

When creating a booking on a page your booking will have to comply with the settings of that page. So if you have a fixed duration it will have to have that number of slots as compared to the display. So for instance if the display is set to 15 minutes, but the duration is 30 minutes, then that would be 2 15 minute slots.

You can set the default to be 15 and the max to be as long as you want. Then you can pass is any number of slots. I hope this helps.

1 Like

Thank you for help @Ben ! That works.

1 Like