The FirstDate web service is the primary entry point for the Booking Module. It is invoked by external systems (e.g., CRM, customer portals) to request an initial appointment proposal for a customer service request.
When called, the service cross-references the input parameters to prevent double-booking, manage duplicate API calls, and determine whether to run the booking optimization algorithm or return an existing appointment.
Input Validation & Routing Logic
Every incoming FirstDate call evaluates two mandatory input fields: requestCode (the external request ID) and activityTypeCode (the Work Order Type). The system determines the workflow based on whether these keys already exist in the database and the current status of the associated appointment:
|
requestCode |
Appointment Status |
System Action & Behavioral Impact |
|
Not associated with an existing WO |
N/A (New Request) |
|
|
Already associated with a WO |
|
Bypasses the algorithm. Returns the exact same appointment data (ID, dates, and times) generated by the previous call. This prevents duplicate slot consumption during page refreshes or active sessions. |
|
Already associated with a WO |
|
Aborts execution. Returns an error message: |
|
Already associated with a WO |
|
Applies the algorithm again. Since the previous slot was cleared due to expiration or manual cancellation right after a First Date call, the system calculates and returns a brand-new appointment proposal. |
Automated Session Cleanup
To keep the forecasting grid clean and prevent ghost reservations from abandoned user sessions, a system background task “Cancel Temporary Expired Appointments in Agenda" monitors temporary records:
-
This background process automatically scans for appointments stuck in a
TEMPORARYstatus. -
If an appointment is not confirmed (
ConfirmDate) within n minutes of its generation (this timeframe parameter is fully configurable via company parameter), the task systematically cancels it. -
The capacity token is instantly returned to the local Time Slot pool, making it available for other customer requests.
Successful Response Output
Upon successful execution, the FirstDate service returns a structured payload containing the following key data points required by the external system:
-
Next-Gen Platform ID: The unique database identifier for the newly generated appointment.
-
Start Date/Time: The exact starting timestamp calculated for the appointment slot.
-
End Date/Time: The exact ending timestamp calculated for the appointment slot.
-
Time Slot ID: The specific capacity container identifier within the NextGen routing grid.