@Nao we are working on updating documentation, that will have some information around booking intents. At a highlevel you first make a POST to: https://api.youcanbook.me/v1/intents
{
"subdomain": "t2eqsdqw",
"selections": {
"timeZone": "Europe/Madrid"
}
}
Change the subdomain you want to book through and the timezone, for the selections you can also pass in additional information there or use the returned intentId and PATCH in:
{
"appointmentTypeIds" : ["jsid213858"],
"duration" : null,
"form" : [ {
"id" : "LNAME",
"value" : "Test"
}, {
"id" : "EMAIL",
"value" : "ben@domain.com"
}, {
"id" : "FNAME",
"value" : "Ben"
} ],
"startsAt" : null,
"teamMemberId" : "AUTO",
"timeZone" : "Europe/Madrid",
"units" : null
}
These selections can be done via PATCH to /v1/intents/{intentId}/selections
To get start time you can use the Availability Endpoint. To do this after you have setup your intent with a timezone, you can GET the availability here: https://api.youcanbook.me/v1/intents/{intentId}/availabilitykey
That will return an Availability key, which you use as a GET here:
https://api.youcanbook.me/v1/availabilities/{availbilityKey}
This will return the Unix timestamp of availability based off of the selections you have made in the intent.
{
"slots" : [ {
"freeUnits" : 1,
"startsAt" : "1691588700000"
}, {
"freeUnits" : 1,
"startsAt" : "1691589600000"
}
}
With the time you can PATCH into the selections of your intent: “startsAt”: “1691588700000” or any other time you get from the Availability Endpoint. Then confirm with a PATCH to:
https://api.youcanbook.me/v1/intents/{intentId}/confirm
Feel free to send me a message here if you have specific questions.