# GetAppointments - Get list of appointments based on the provided search criteria

This API queries the appointment database to return appointments matching the specified filters.
Results are paginated and sorted by appointment start date (descending), then by truck visit ID (descending).
Request Fields:
- GateApptStart_DtTm (required): Start of the date range filter. Accepted formats: yyyy-MM-ddTHH:mm:ss, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd.
- GateApptEnd_DtTm (required): End of the date range filter. Must be greater than or equal to GateApptStart_DtTm. If the range exceeds 30 days, only the most recent 30 days of data will be returned.
- ApptType_Cd (optional): Comma-separated appointment type codes to filter by (e.g., "IP,EF").
- ApptStatus_Cd (optional): Comma-separated appointment status codes to filter by (e.g., "C,P").
- Facility_Cd (optional): Comma-separated facility codes to filter by (e.g., "PCT,ITS").
- CargoRef_Num (optional): Comma-separated cargo reference numbers to filter by.
- Container_Num (optional): Comma-separated container numbers to filter by.
- Page (optional, default: 1): Page number for pagination. Must be a positive integer.
- Page_Size (optional, default: 50): Number of records per page. Must be between 1 and 1000.
Response:
The response contains a status indicator and a list of visits, each containing visit-level details and associated moves with appointment information including type, status, container, shipping line, and timestamps.

Endpoint: POST /api/appointment/getappointments
Version: 1.0

## Header parameters:

  - `X-Cargosprint-Api-Key` (string, required)
    The company API key provided by Cargosprint.

  - `X-Cargosprint-User-Key` (string, required)
    The API key of the user to be impersonated.

## Request body:

  - `application/json` (unknown)
    The request object containing the search criteria and pagination parameters for filtering appointments.

## Request fields (application/json):

  - `gateApptStart_DtTm` (string)

  - `gateApptEnd_DtTm` (string)

  - `apptType_Cd` (string)

  - `apptStatus_Cd` (string)

  - `facility_Cd` (string)

  - `cargoRef_Num` (string)

  - `container_Num` (string)

  - `page` (integer)

  - `page_Size` (integer)

## Request examples:

  - `Get trucker appointments filtered by date, type, facility, status, reference and container.` (unknown)

## Response 200:

  - `200` (unknown)
    Appointments retrieved successfully.

## Response 200 fields (application/json):

  - `status` (object)

  - `status.statusCode` (integer)

  - `status.reasonPhrase` (string)

  - `responseBody` (object)

  - `responseBody.visits` (array)

  - `responseBody.visits.visitBusn_Dt` (string)

  - `responseBody.visits.visitFrom_Tm` (string)

  - `responseBody.visits.visitTo_Tm` (string)

  - `responseBody.visits.faclility_Cd` (string)

  - `responseBody.visits.truckPlate_Num` (string)

  - `responseBody.visits.truckVisit_Id` (integer)

  - `responseBody.visits.visitDisplay_Nm` (string)

  - `responseBody.visits.externalVisitRef_Nbr` (integer)

  - `responseBody.visits.moves` (array)

  - `responseBody.visits.moves.gateAppt_Id` (integer)

  - `responseBody.visits.moves.apptType_Cd` (string)

  - `responseBody.visits.moves.apptType_Dsc` (string)

  - `responseBody.visits.moves.apptStatus_Cd` (string)

  - `responseBody.visits.moves.apptStatus_Dsc` (string)

  - `responseBody.visits.moves.tosStatus_Cd` (string)

  - `responseBody.visits.moves.container_Num` (string)

  - `responseBody.visits.moves.shippingLine_Cd` (string)

  - `responseBody.visits.moves.equipmentISO_Cd` (string)

  - `responseBody.visits.moves.cargoRef_Num` (string)

  - `responseBody.visits.moves.create_DtTm` (string)

  - `responseBody.visits.moves.modify_DtTm` (string)

## Response 400:

  - `400` (unknown)
    Bad request due to missing or invalid required fields such as date range or pagination parameters.

## Response 400 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized. The client must authenticate itself to get the requested response.

## Response 401 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

## Response 403:

  - `403` (unknown)
    Forbidden. The client does not have access rights to the content.

## Response 403 fields (application/json):

  - `type` (string)

  - `title` (string)

  - `status` (integer)

  - `detail` (string)

  - `instance` (string)

## Response 500:

  - `500` (unknown)
    An internal server error occurred while processing the request.

## Response 200 examples:

  - `List of matching trucker appointments grouped by visit.` (unknown)

