Skip to main content

Chat


Use the Chat module to send secure, real-time messages between users and Air Doctor support.
Each thread is linked to a specific appointment and retains the full message history for compliance and auditing.


This screen includes:

  • Chat threads grouped by appointment in chronological order.
  • Sender identity and timestamps for each message.
  • Support for text messages and one file attachment per message.
  • Unread indicators for inactive threads with new messages.
  • Message access restrictions based on appointment status.
  • Infinite scroll to load older messages.
  • Visual styling that distinguishes incoming and outgoing messages.
  • Persistent message history for transparency and audit purposes.

Workflow

  1. From the navigation menu or an appointment screen, select Chat with support.

  2. Type a message in the input field.
    The Send icon is disabled until the message is valid.

  3. Confirm that the message appears in the thread.

    Unread Messages

    A red badge on the chat icon indicates unread messages.


Validations

  • Message Field: Rejects empty input.
  • Attachment Upload: Accepts one file. Validates file type and size.
  • Chat Availability: Restricts chat access to active appointments only.
  • Load More: Appears only when older messages exist.
  • Unread Indicator: Displays for inactive threads with unread messages.

Actions

  • Open Chat: Launches the chat panel for the selected appointment.
  • Scroll to Load More: Loads older messages dynamically.
  • Type Message: Enables the send icon when the input or attachment is valid.
  • Attach File: Displays the uploaded filename. Replaces any existing attachment.
  • Send Message: Posts the message and clears the input field.
  • Unread Divider: Displays a divider when new messages arrive during inactivity.
  • Close Chat: Dismisses the chat window and marks the conversation as read.

Endpoint Resources

PUT 

Chat

/profile/messages/user-chat

Returns the secure chat interface for a specific appointment or general support. Mobile opens as full screen; desktop displays as an embedded panel or floating window

VariantBehaviorExample
MobileOpens as a full-screen interface. User can type and send messages from a dedicated page.
DesktopAppears embedded in the appointment list or as a floating window near the bottom-right side.

UI Element Types

LevelReferenceTypeValuePlacement
D-1spacerSpacer(for CS Chat on desktop, which is a popup)
D-1closeLink[x] (for CS Chat on desktop, which is a popup)~
M-1tagRegularAppointment #appointment id
M-1scrollScroller
1spacerSpacer
2load-moreLinkLoad more messages...^
2incoming-{messageId}Group90%
3attachmentViewerAttachment, if present
2new-message-lineLine
2new-messageCaptionNew messages~
2new-message-lineLine~
2spacerSpacer10%
2outgoing-{messageId}Group~90%
3attachmentViewerAttachment, if present
2newer-messages-markerSpacer(invisible; newer messages marker)
1lineLine
1contentEditStart typing
1uploadUpload(maximum one file)
1sendLink[>]

Get Previous Messages​

PATCH 

/profile/messages/load-more

Retrieves older messages in the chat thread after the user selects Show previous messages. The update preserves the current scroll position.

Update Chat

PATCH 

/profile/messages/load-more

Displays new messages in the active chat thread immediately after they are sent or received. The update preserves conversation state and scroll position.

Save Message

POST 

/profile/messages/send-message

Uploads a file, such as a PDF or image, to a chat thread. The message is always linked to a specific appointment.

Parameters

NameTypeRequiredDescription
contentStringYesMessage body text
appointment-idintYesAppointment ID for associating the message
fileFileYesFile attachment, such as PDF, image, or document

Errors

CodeDescription
FIELDS_VALIDATION_ERROROne or more input fields are missing or invalid