The following should be enough information to allow appointments to be created, modified, deleted, and retrieved through the API.
Retrieving available appointment allocation slots
To retrieve available appointment allocation slots, you will first need to retrieve the possible appointment types. A collection of all the possible appointment types can be accessed via calling the appointment types call in the API:
GET /v3/diary/{shortName}/appointmenttypes
After an appointment type is retrieved, appointment type can be piped into the retrieve allocations call:
GET /v3/diary/{shortName}/allocations
This will retrieve a list of all available slots an appointment can be allocated to, from the preferred date and the following 7 days.
Retrieving Appointments
Appointments can be retrieved in two ways. A collection of appointments between two dates can be retrieved by using the following endpoint.
GET /v3/diary/{shortName}/appointmentsbetweendates
This will return all appointments that match the search criteria piped in to the request model. The minimum start date for the above call must be within 30 days of the current date.
If the appointment ID is already known, then an appointment can also be retrieved by using the appointment ID. To retrieve the appointment by appointment ID, the following endpoint should be used.
GET /v3/diary/{shortName}/appointment
The appointment model returned for both endpoints will be the same.
Creating a new appointment
To create a new appointment, you will need to have retrieved an available appointment allocation. When you have an available appointment allocation, you will need to call the following endpoint in the API:
POST /v3/diary/{shortName}/appointment
Into appointment details, you will need to pipe in data in the following format:
Allocation details will be the appointment allocation retrieved via get allocations, and appointment type will be the value retrieved from appointment types.
Updating existing appointments
In order to update an appointment, first you will need to retrieve the appointment through the API. To retrieve an appointment you will need to call the appointments between dates endpoint:
GET /v3/diary/{shortName}/appointmentsbetweendates
After you've retrieved the the appointment, you can call the update appointment endpoint:
PUT /v3/diary/{shortName}/appointment
It will require the appointment ID retrieved from the appointments between dates, and it will require appointment details input in the following format:
Fields that don't require updating can be omitted from the submission model. If a appointment needs to be updated to be on a different property, the appointment will need to be deleted, and a new appointment created.
Deleting an appointment
To delete an appointment, first you must retrieve the appointment, same as updating an appointment. After the appointment is retrieved it can be deleted by calling the following endpoint:
DELETE /v3/diary/{shortName}/appointment
This will delete the appointment linked to the appointment ID passed into the call.
Comments
0 comments
Please sign in to leave a comment.