Scheduling
L'API timum gestisce le disponibilità (Timeslots), gli appuntamenti (Appointments), le partecipazioni (Participations) e i clienti: il cuore della pianificazione degli appuntamenti.
Panoramica dei concetti
Timeslots (Disponibilità)
Un Timeslot definisce che una risorsa è disponibile per un periodo di tempo. Il periodo viene suddiviso in slot prenotabili tramite una griglia.
Concetto di griglia
Create Timeslots
Crea uno o più Timeslot per una risorsa.
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/timeslots" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"timeslots": [
{
"reference": "tsl-2024-01-15@yourCrm",
"resourceReference": "res-musterstr1@yourCrm",
"start": "2024-01-15T09:00",
"end": "2024-01-15T17:00",
"raster": 30,
"defaultCapacity": 1,
"defaultAcceptBookings": true,
"address": {
"city": "Berlin",
"zip": "10115",
"country": "DE",
"street": "Musterstraße",
"number": "1"
},
"state": "BOOKABLE"
}
]
}'
Request Body
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
timeslots | array | Sì | Array di oggetti Timeslot |
Campi dell'oggetto Timeslot
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
reference | string | No | Riferimento Timeslot univoco (generato se non specificato) |
resourceReference | string | Sì | Riferimento della risorsa associata |
start | datetime | No | Inizio del Timeslot (ISO 8601) |
end | datetime | Sì | Fine del Timeslot (ISO 8601) |
raster | number | Sì | Durata di uno slot di prenotazione in minuti. Suddivide il Timeslot in unità prenotabili. |
defaultCapacity | number | Sì | Numero massimo di partecipanti per Appointment creato |
defaultAcceptBookings | boolean | Sì | true: prenotabile pubblicamente. false: l'Appointment diventa privato (ulteriori prenotazioni solo da parte del fornitore). |
address | object | string | No | Indirizzo per gli Appointment. Può essere un oggetto o una stringa (ad es. "Zoom: https://zoom.us/j/123") |
state | string | Sì | CREATED: nascosto (fase di pianificazione). BOOKABLE: visibile pubblicamente e prenotabile. |
{
"address": "Zoom-Meeting: https://zoom.us/j/123456789"
}
Get Timeslots
Recupera tutti i Timeslot di una risorsa in un determinato periodo.
curl -X GET "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/resource/res-musterstr1@yourCrm/timeslots?from=2024-01-15T00:00&to=2024-01-22T00:00" \
-H "X-TIMUM-CLIENT-ID: your-api-key"
Parametri di query
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
from | datetime | Sì | Data di inizio (ISO 8601) |
to | datetime | Sì | Data di fine (ISO 8601) |
Appointment inclusi
Update Timeslot
Aggiorna un Timeslot esistente. Vengono modificati solo i campi forniti.
curl -X PUT "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/timeslots/tsl-2024-01-15@yourCrm" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"start": "2024-01-15T10:00",
"end": "2024-01-15T16:00",
"raster": 30,
"defaultCapacity": 2,
"defaultAcceptBookings": true,
"state": "BOOKABLE"
}'
Delete Timeslot
Elimina un Timeslot.
curl -X DELETE "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/timeslots/tsl-2024-01-15@yourCrm" \
-H "X-TIMUM-CLIENT-ID: your-api-key"
Prerequisito
Appointments (Appuntamenti)
Gli Appointment sono appuntamenti prenotati. Possono essere creati singolarmente, come sequenza o come serie su più giorni.
Get Appointments
Recupera gli Appointment di un fornitore. Include appuntamenti attivi e annullati.
curl -X GET "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/appointments?productRef=prod-besichtigung@yourCrm&resourceRef=res-musterstr1@yourCrm&includeArchived=false" \
-H "X-TIMUM-CLIENT-ID: your-api-key"
Parametri di query
| Parametro | Tipo | Descrizione |
|---|---|---|
productRef | string | Filtro per prodotto (opzionale) |
resourceRef | string | Filtro per risorsa (opzionale) |
includeArchived | boolean | Includere gli Appointment archiviati (predefinito: false) |
Response
[
{
"reference": "apt-001@yourCrm",
"acceptBookings": true,
"address": {
"city": "Berlin",
"countryCode": "DE",
"street": "Musterstraße",
"number": "1",
"zip": "10115"
},
"archived": false,
"capacity": 1,
"contactReference": "user-123@yourCrm",
"description": "Besichtigung",
"start": "2024-01-15T10:00:00Z",
"end": "2024-01-15T10:30:00Z",
"notes": null,
"participations": [
{
"reference": "part-001@yourCrm",
"email": "kunde@example.com",
"mobile": "+49 170 9876543",
"name": "Max Kunde",
"note": "",
"state": "BOOKED",
"messages": null
}
],
"price": null,
"productReference": "prod-besichtigung@yourCrm",
"resourceReference": "res-musterstr1@yourCrm",
"seriesId": null,
"state": "ACTIVE"
}
]
Create Appointments
Crea Appointment. Supporta appuntamenti singoli, sequenze e serie.
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/appointments" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"reference": "apt-001@yourCrm",
"start": "2024-01-15T10:00",
"end": "2024-01-15T11:00",
"capacity": 1,
"acceptBookings": true,
"resourceReference": "res-musterstr1@yourCrm",
"productReference": "prod-besichtigung@yourCrm",
"productName": "Besichtigung",
"contactReference": "user-123@yourCrm",
"address": {
"city": "Berlin",
"zip": "10115",
"country": "DE",
"street": "Musterstraße",
"number": "1"
},
"participations": [
{
"reference": "part-001@yourCrm",
"name": "Max Kunde",
"email": "kunde@example.com",
"mobile": "+49 170 9876543",
"note": "Interessiert an 3-Zimmer-Wohnung",
"state": "BOOKED"
}
],
"price": {
"value": 0.00,
"currency": "EUR"
}
}'
Request Body (Appuntamento singolo)
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
reference | string | Sì* | *Obbligatorio per appuntamento singolo, ignorato per la serie |
start | datetime | Sì | Inizio (ISO 8601) |
end | datetime | Sì | Fine (ISO 8601) |
capacity | number | No | Max. partecipanti (predefinito: 0) |
acceptBookings | boolean | No | Prenotabile pubblicamente (predefinito: false) |
resourceReference | string | Sì | Riferimento della risorsa |
productReference | string | Sì | Riferimento del prodotto |
productName | string | No | Sovrascrive il nome del prodotto |
contactReference | string | No | Staff responsabile |
address | object | string | No | Indirizzo (predefinito: indirizzo della risorsa) |
participations | array | No | Partecipanti dell'Appointment |
price | object | No | Prezzo (value, currency: EUR/CHF) |
Oggetto Participation
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
reference | string | Sì* | *Obbligatorio per appuntamento singolo |
name | string | Sì | Nome del partecipante |
email | string | Sì | E-mail del partecipante |
mobile | string | No | Numero di cellulare |
note | string | No | Nota sul partecipante |
state | string | Sì | RESERVED, REQUESTED, BOOKED, CANCELED, DELETED |
Stato RESERVED
Creare una serie
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/appointments" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"from": "2024-01-15T09:00",
"to": "2024-01-15T17:00",
"capacity": 1,
"acceptBookings": true,
"resourceReference": "res-musterstr1@yourCrm",
"productReference": "prod-besichtigung@yourCrm",
"series_data": {
"from": "2024-01-15T09:00",
"to": "2024-01-19T17:00",
"raster": 30,
"weekdays": ["1", "2", "3", "4", "5"]
}
}'
Oggetto series_data
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
from | datetime | Sì | Inizio della serie (ISO 8601) |
to | datetime | Sì | Fine della serie (ISO 8601) |
raster | number | Sì | Durata dello slot in minuti |
weekdays | string[] | No* | *Obbligatorio per più di 1 giorno. Array di giorni della settimana: "1"=lun a "7"=dom |
Delete Appointments (senza notifica)
Elimina gli Appointment senza notificare i partecipanti. Per correzioni amministrative.
curl -X DELETE "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/appointments/withoutNotification" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"appointmentReference": "apt-001@yourCrm"
}'
Request Body
| Campo | Tipo | Descrizione |
|---|---|---|
appointmentReference | string | Riferimento dell'Appointment da eliminare |
seriesId | string | OPPURE: ID di una serie (elimina tutti gli Appointment della serie) |
Nessuna notifica
Cancel Appointments
Annulla gli Appointment e notifica tutti i partecipanti via e-mail.
curl -X DELETE "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/appointments?message=Der%20Termin%20muss%20leider%20abgesagt%20werden" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"appointmentReference": "apt-001@yourCrm"
}'
Parametri di query
| Parametro | Tipo | Descrizione |
|---|---|---|
message | string | Messaggio ai partecipanti (nell'e-mail di annullamento) |
Comportamento
- Imposta lo stato dell'Appointment su CANCELLED
- Imposta tutti gli stati di Participation su CANCELLED
- Invia e-mail di annullamento a tutti i partecipanti
- L'Appointment non è più prenotabile
Participations (Partecipazioni)
Le Participation collegano i Customer agli Appointment. Ogni Participation ha uno stato che riflette il processo di prenotazione.
Participation States
| Stato | Descrizione |
|---|---|
RESERVED | Riservato temporaneamente. Viene eliminato automaticamente dopo 3 minuti. |
REQUESTED | Richiesta inviata, in attesa di conferma da parte del fornitore. |
BOOKED | Confermato e prenotato. |
CANCELED | Annullato dal Customer o dal fornitore. |
DELETED | Eliminato amministrativamente (senza notifica). |
Create Participation
Aggiunge un Customer a un Appointment.
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/participations?ignoreCapacity=false&onDuplicateRaise=false&sendMails=true" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"reference": "part-002@yourCrm",
"appointmentReference": "apt-001@yourCrm",
"customerReference": "cust-001@yourCrm",
"state": "BOOKED",
"message": "Bestätigung Ihrer Terminbuchung"
}'
Parametri di query
| Parametro | Tipo | Predefinito | Descrizione |
|---|---|---|---|
ignoreCapacity | boolean | false | Aggiungere la Participation anche a capacità piena |
onDuplicateRaise | boolean | false | Per un riferimento esistente: true=errore, false=aggiornamento |
sendMails | boolean | true | Inviare e-mail di notifica |
Request Body
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
reference | string | Sì | Riferimento Participation univoco |
appointmentReference | string | Sì | Riferimento dell'Appointment |
customerReference | string | Sì | Riferimento del Customer |
state | string | Sì | RESERVED, REQUESTED, BOOKED, CANCELED, DELETED |
message | string | No | Messaggio nell'e-mail al Customer |
Update Participation
Modifica lo stato di una Participation.
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/participations/part-002@yourCrm?sendMails=true" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"state": "CANCELED",
"message": "Leider müssen wir Ihren Termin stornieren."
}'
Transizioni di stato con invio di e-mail
| Transizione | Email? |
|---|---|
| RESERVED → BOOKED | ✓ Sì |
| REQUESTED → BOOKED | ✓ Sì |
| REQUESTED → CANCELED | ✓ Sì |
| BOOKED → CANCELED | ✓ Sì |
| RESERVED → CANCELED | ✗ No |
| DELETED → CANCELED | ✗ No |
| BOOKED → DELETED | ✗ No (!) |
Transizioni non supportate
Customers (Clienti)
I Customer sono persone che prenotano appuntamenti. Appartengono a un fornitore e possono partecipare a più Appointment.
Get Customer
Recupera un Customer in base al suo riferimento.
curl -X GET "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/customers/cust-001@yourCrm" \
-H "X-TIMUM-CLIENT-ID: your-api-key"
Response
{
"api-info": {
"version": "1"
},
"customer": {
"customerReference": "cust-001@yourCrm",
"email": "kunde@example.com",
"note": "Interessiert an 3-Zimmer-Wohnungen",
"userName": "Max Kunde",
"mobile": "+49 170 9876543",
"language": "de",
"providerReference": "prov-001@yourCrm"
}
}
Status Codes
| Codice | Significato |
|---|---|
200 | Customer trovato |
204 | Nessun Customer trovato con questo riferimento |
Create Customer
Crea un nuovo Customer per un fornitore.
curl -X POST "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/customers" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"customerReference": "cust-001@yourCrm",
"providerReference": "prov-001@yourCrm",
"userName": "Max Kunde",
"email": "kunde@example.com",
"mobile": "+49 170 9876543",
"note": "Interessiert an 3-Zimmer-Wohnungen",
"language": "de"
}'
Request Body
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
customerReference | string | Sì | Riferimento Customer univoco |
providerReference | string | Sì | Riferimento del fornitore |
userName | string | Sì | Nome del cliente |
email | string | No | Indirizzo e-mail |
mobile | string | No | Numero di cellulare (con prefisso internazionale) |
note | string | No | Nota interna (max. 1023 caratteri) |
language | string | No | Codice lingua (de, en, ecc.) |
Status Codes
| Codice | Significato |
|---|---|
201 | Nuovo Customer creato |
200 | Il Customer esiste già |
Update Customer
Aggiorna un Customer esistente.
curl -X PUT "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/customers/cust-001@yourCrm" \
-H "X-TIMUM-CLIENT-ID: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"customerReference": "cust-001-new@yourCrm",
"email": "neue-email@example.com",
"userName": "Max Neukunde",
"mobile": "+49 170 1111111",
"note": "Aktualisierte Notiz"
}'
Modificare il riferimento
Delete Customer
Elimina un Customer.
curl -X DELETE "https://www.timum.de/crms/{crmId}/provider/prov-001@yourCrm/customers/cust-001@yourCrm?ignoreFutureAppointments" \
-H "X-TIMUM-CLIENT-ID: your-api-key"
Parametri di query
| Parametro | Descrizione |
|---|---|
ignoreFutureAppointments | Se impostato: rimuove il Customer da tutti gli Appointment futuri. Il Customer viene notificato via e-mail (se configurato). |
Appointment futuri
GDPR
Prossimi passi
- Booking Flow - Endpoint rivolti al consumatore per le prenotazioni
