Show Appointments

Muestra las citas de un contacto aplicando criterios de filtrado

Overview

This node, named "Show Appointments," retrieves and displays appointments for a specified contact from an external service. It allows filtering the appointments by their status (New, Confirmed, Cancelled) and by date relative to the current time (past or future). This node is useful in scenarios where you want to integrate appointment data into your workflow, such as sending reminders, updating CRM records, or generating reports based on appointment statuses and timings.

Practical examples:

  • Fetch all upcoming confirmed appointments for a client to send reminder emails.
  • Retrieve past cancelled appointments to analyze cancellation patterns.
  • Display new appointments scheduled for today in a dashboard.

Properties

Name Meaning
Contact ID The unique identifier of the contact whose appointments are to be retrieved.
API Token (Pit-Token) Bearer token used for authenticating API requests to the external appointment service.
Appointment Status Filter Filter appointments by their status. Options: New, Confirmed, Cancelled.
Appointment Date Filter Filter appointments by date relative to now. Options: Before Now (past appointments), After Now (future appointments).
Show Status Filter Boolean flag to show or hide the status filter option in the node's UI.
Show Date Filter Boolean flag to show or hide the date filter option in the node's UI.

Output

The node outputs a single JSON object containing a response field. This field holds an array of appointment objects fetched from the external service after applying the selected filters.

Example structure of output JSON:

{
  "response": [
    {
      "appointmentStatus": "new",
      "startTime": "2024-06-01T10:00:00Z",
      "otherAppointmentDetails": "..."
    },
    {
      "appointmentStatus": "confirmed",
      "startTime": "2024-06-02T14:00:00Z",
      "otherAppointmentDetails": "..."
    }
  ]
}

No binary data output is produced by this node.

Dependencies

  • Requires access to an external API endpoint at https://services.leadconnectorhq.com/contacts/{contactId}/appointments.
  • Needs a valid API authentication token (Bearer token) provided via the "API Token (Pit-Token)" property.
  • The node uses HTTP GET requests with specific headers including authorization and content type.
  • No additional environment variables or n8n-specific credentials beyond the API token are required.

Troubleshooting

  • Missing Required Data: If either the Contact ID or API token is missing, the node will throw an error indicating that required data is missing.
  • Invalid Appointment Status Filter: If a status filter is provided but does not match one of the allowed values ("NEW", "CONFIRMED", "CANCELLED"), an error will be thrown specifying the valid options.
  • Invalid Date Filter: If the date filter value is not one of the expected options ("BEFORE_NOW" or "AFTER_NOW"), the node will throw an error explaining the valid choices.
  • API Request Failures: Any issues with the HTTP request (e.g., network errors, invalid token) will result in an error message prefixed with "Error en el nodo custom (ShowAppointments):" followed by the original error details.
  • Filtering Logic: The date filtering compares appointment start times against the current system time; ensure the system clock is accurate to avoid unexpected filtering results.

Links and References

  • Node Documentation URL - Official documentation for the node package.
  • External API documentation should be consulted for detailed information about the appointments endpoint and authentication requirements (not included in the source code).

Discussion