Appointment Scheduling AJAX Endpoints

Print Friendly and PDF Follow

As of Aeon 5.1, new AJAX (Asynchronous Javascript and XML) endpoints were added to return JSON responses containing all available appointments for a user, all available reading rooms, and appointment availability for a given room and date. Two additional endpoints were also added to handle creating and rescheduling appointments.  

JSON Object Returned

Successful calls to one of these endpoints will return a JSON object with a status property that has the value "success" and a data property that contains the data returned from the operation.

{ "status": "success", "data": { .... }}

Unsuccessful calls to one of these endpoints will return a JSON object with a status property that indicates whether the request failed because insufficient information was submitted (status = 'fail') or because there was an unrelated server error (status = 'error'), along with a message property to explain the error.

{ "status": "fail", "message": "AppointmentID is a required field."}
{ "status": "error", "message": "Unable to retrieve appointment details."} 

AJAX Endpoints

GetAppointments 

Returns a list of available appointments for a user or their researcher that are still pending (i.e. their StopTime is still in the future). If the reading room does not require appointments, an empty result will also be included in the result set to allow for submitting a request without an appointment.

Parameters

Name Required/Optional Description
ReadingRoomID Required The ID of the reading room to which the appointments must belong.
ResearcherUsername Optional If ResearcherUsername is provided, the AJAX method will return only appointments for that researcher that are available to proxies and only if the current user is a proxy for the said researcher. Otherwise, it will return only appointments for the current user. This information is determined from the user's active web session.
TransactionNumber Optional If TransactionNumber is provided and the transaction has a linked appointment, that appointment will be included in the results even if it doesn't meet the other criteria or has already passed its expiration date.

Data Returned

A JSON object representing the list of appointments.

GetReadingRooms 

Returns a list of reading rooms, restricting the list to those associated with a specific site if this parameter is provided. This AJAX method is available anonymously, i.e. it does not require an active web session.

Parameters

Name Required/Optional Description
Site Optional When provided, the list of returned reading rooms will be limited to those associated with the given site as determined through the ReadingRoomsForSites database table.

Data Returned

A JSON object representing the list of reading rooms.

GetAppointmentAvailability

Returns a list of available appointment slots for the given reading room and date.

Parameters

Name Required/Optional Description
ReadingRoomID Required The ID of the reading room.
AppointmentDate Required The date of the appointment.

Data Returned

A JSON object containing the standard AppointmentAvailability fields (UTCStartTime, StartTime, SeatsAvailable, and MaximumAppointmentLength) as well as an additional field named StartTime-ISO8601. This field will contain the StartTime data formatted in the ISO 8601 standard for convenience of use, while the UTCStartTime and StartTime fields will be formatted using the system standard (e.g., month/day/year for US servers).

CreateAppointment

Creates an appointment for a given user, reading room, and time slot.

Parameters

Name Required/Optional Description
ReadingRoomID Required The ID of the reading room in which to schedule the appointment.
StartTime Required The start time of the appointment in the time zone of the reading room.
StopTime Required The end time of the appointment in the time zone of the reading room.
Name Optional The name for the appointment.
ResearcherUsername Optional If specified, the appointment will be created for the researcher instead of the current user.
AvailableToProxies Optional Specifies whether the appointment will be available to proxy users. If ResearcherUsername is provided, this value will default to true.

Data Returned

A JSON object representing the created appointment.

RescheduleAppointment

Reschedules an existing appointment.

Parameters

Name Required/Optional Description
AppointmentID Required The ID of the appointment being rescheduled.
StartTime Required The start time of the new appointment time slot.
StopTime Required The end time of the new appointment time slot
Name Optional Specifies a new name for the appointment.

Data Returned

A JSON object representing the rescheduled appointment.

Questions?

If this article didn’t resolve your issue, please contact Atlas Support for assistance:

Contact Support