curl --request POST \
--url https://api.dentalspace.ai/v1/calendars/{id}/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reason": "<string>",
"origin": "api"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
patientId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start: '2023-11-07T05:31:56Z',
doctorId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
reason: '<string>',
origin: 'api'
})
};
fetch('https://api.dentalspace.ai/v1/calendars/{id}/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/calendars/{id}/bookings"
payload = {
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reason": "<string>",
"origin": "api"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"calendarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "<string>",
"end": "<string>",
"status": "draft",
"type": "checkup",
"category": "recall",
"title": "<string>",
"reason": "<string>",
"origin": "manual",
"treatmentPlanId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"updatedAt": "<string>",
"notes": "<string>",
"clinicalNotes": "<string>",
"completionNotes": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Prenota un orario
Scope: appointments:write.
Ricontrolla l’orario con le regole del calendario e lo prenota (stato scheduled). 409 no_availability se non e’ piu’ libero (reason: slot_taken) o non rispetta il preavviso (reason: min_notice), con details.alternatives; 409 conflict con reason: booking_disabled se il calendario non accetta prenotazioni da fuori.
curl --request POST \
--url https://api.dentalspace.ai/v1/calendars/{id}/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reason": "<string>",
"origin": "api"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
patientId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start: '2023-11-07T05:31:56Z',
doctorId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
reason: '<string>',
origin: 'api'
})
};
fetch('https://api.dentalspace.ai/v1/calendars/{id}/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/calendars/{id}/bookings"
payload = {
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reason": "<string>",
"origin": "api"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"doctorId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"calendarId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "<string>",
"end": "<string>",
"status": "draft",
"type": "checkup",
"category": "recall",
"title": "<string>",
"reason": "<string>",
"origin": "manual",
"treatmentPlanId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"updatedAt": "<string>",
"notes": "<string>",
"clinicalNotes": "<string>",
"completionNotes": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Obbligatoria. La stessa chiave entro 24 ore ripete la prima risposta 2xx.
255Path Parameters
Identificativo della risorsa.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Body
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$L'inizio di uno degli orari di /availability, tale e quale.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Il medico scelto; senza, lo sceglie il calendario (abituale, poi il primo libero).
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Senza, il nome del calendario.
1 - 200Il motivo della visita, come lo dice il paziente.
2000voice se prenota l'agente vocale.
api, voice Response
L'appuntamento prenotato.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$Il calendario da cui e' nato: le sue regole valgono per spostarlo e disdirlo. null = fuori calendario.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$ISO 8601 con fuso (UTC).
ISO 8601 con fuso (UTC).
draft, scheduled, confirmed, checked_in, in_progress, completed, cancelled, no_show, pending, postponed checkup, treatment, consultation, emergency, other recall, treatment_plan, first_visit, case_study, standard Ogni lettura finisce nel registro accessi (testo libero).
Il motivo della visita. Ogni lettura finisce nel registro accessi (testo libero).
Da dove e' nato: manual (agenda), bot (WhatsApp), voice (agente vocale), api.
manual, bot, voice, api ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$ISO 8601 con fuso (UTC).
ISO 8601 con fuso (UTC).
Solo con lo scope clinical:read (l'accesso finisce nel registro).
Solo con lo scope clinical:read (l'accesso finisce nel registro).
Solo con lo scope clinical:read.