Optional
headersOptional headers of the message.
The headers are a flat key-value map and are sent as part of the realtime
message's extras inside the headers
property. They can serve similar
purposes as the metadata, but they are read by Ably and can be used for
features such as
subscription filters.
Do not use the headers for authoritative information. There is no server-side validation. When reading the headers, treat them like user input.
Optional
metadataOptional metadata of the message.
The metadata is a map of extra information that can be attached to chat messages. It is not used by Ably and is sent as part of the realtime message payload. Example use cases are setting custom styling like background or text colors or fonts, adding links to external images, emojis, etc.
Do not use metadata for authoritative information. There is no server-side validation. When reading the metadata, treat it like user input.
The text of the message.
Params for sending a text message. Only
text
is mandatory.