Prenota un orario
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>"
}
}Agenda
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.
POST
/
calendars
/
{id}
/
bookings
Prenota un orario
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
Headers
Path Parameters
Body
application/json
L'inizio di uno degli orari di /availability, tale e quale.
Pattern:
^(?:(?:\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)))$Response
L'appuntamento prenotato.