Skip to main content

Chat


Use the Chat screen to exchange secure messages between doctors and Air Doctor support.
Each chat thread links to a specific appointment and preserves the full message history for compliance and audit purposes.
The Doctor App opens this screen from the navigation menu or from supported appointment-related entry points.


This screen includes:

  • A list of chat threads grouped by appointment and ordered by activity.
  • Sender identification and timestamps for each message.
  • Support for text messages and a single file attachment per message.
  • Visual separation between incoming and outgoing messages.
  • Unread indicators for threads with new messages.
  • Infinite scrolling to load older messages.
  • Message visibility rules based on appointment state.
  • Persistent message history for audit and review.

Workflows

Send a Message

  1. From the navigation menu or an appointment screen, select Chat with support.
  2. In the message input field, enter a message.
  3. (Optional) Attach one file.
  4. Select Send.
  5. Verify that the message appears in the chat thread.

View Previous Messages

  1. Open an existing chat thread.
  2. Scroll upward.
  3. Select Load more messages when available.
  4. Review earlier messages without changing the current scroll context.

Validations

These scenarios describe how the app validates the Chat screen and what the integrator can expect.

ScenarioApp BehaviorSDK OutputExample
The user submits an empty message.The app disables the send action.No request sent.
The user attaches more than one file.The app replaces the existing attachment.Updated draft state only.
The file exceeds size or type limits.The app blocks upload and displays feedback.Validation error; message not sent.
The appointment does not support chat.The app blocks chat access.Error response.
Older messages exist in the thread.The app displays Load more messages.Patch response with older messages.

Actions

These scenarios describe how the app responds to actions on the Chat screen and what the SDK returns.

ScenarioApp BehaviorSDK OutputExample
The user sends a valid message.The app appends the message to the thread and clears the input.Update set with new message.
The user loads previous messages.The app prepends older messages and preserves scroll position.Update set with older messages.
A new message arrives in an inactive thread.The app displays an unread indicator.Thread metadata update.
The user closes the chat.The app marks messages as read.State update only.

Endpoint Resources

Present Chat

PUT 

/profile/messages/user-chat

Returns the chat interface for the selected appointment or support context.
On mobile devices, the app displays a full-screen view.
On desktop devices, the app displays an embedded or floating panel.

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[>]

Load Previous Messages​

PATCH 

/profile/messages/load-more

Returns older messages for the active chat thread and preserves scroll position.

Update Send Message

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

Creates a new chat message linked to a specific appointment.
The request supports plain text messages and an optional single file attachment.

Parameters

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

Errors

CodeDescription
DOCTOR_COMMUNITY_CHAT_DISABLEDChat is disabled for this appointment
FIELDS_VALIDATION_ERROROne or more input fields are missing or invalid