From 81eedc9cf118261ea859f5d798ddf9fee9a7e1ba Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Tue, 21 Oct 2025 11:45:59 +0100 Subject: [PATCH] Migrate Realtime SDK API spec Messages page to MDX --- content/api/realtime-sdk/messages.textile | 32 ------ src/pages/docs/api/realtime-sdk/messages.mdx | 109 +++++++++++++++++++ 2 files changed, 109 insertions(+), 32 deletions(-) delete mode 100644 content/api/realtime-sdk/messages.textile create mode 100644 src/pages/docs/api/realtime-sdk/messages.mdx diff --git a/content/api/realtime-sdk/messages.textile b/content/api/realtime-sdk/messages.textile deleted file mode 100644 index c4519ed736..0000000000 --- a/content/api/realtime-sdk/messages.textile +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: Messages -meta_description: "Realtime Client Library SDK API reference section for the message object." -meta_keywords: "Ably, Ably realtime, API Reference, Realtime SDK, message, messages" -section: api -languages: - - javascript - - nodejs - - ruby - - java - - swift - - objc - - csharp - - flutter -redirect_from: - - /docs/api/versions/v1.1/realtime-sdk/messages - - /docs/api/versions/v1.0/realtime-sdk/messages - - /docs/api/versions/v0.8/realtime-sdk/messages ---- - -h2(#properties). - default: Properties - java: Members - ruby: Attributes - python: Attributes - -<%= partial partial_version('types/_message') %> - -h2(#message-annotations). - default: MessageAnnotations - -<%= partial partial_version('types/_message_annotations') %> diff --git a/src/pages/docs/api/realtime-sdk/messages.mdx b/src/pages/docs/api/realtime-sdk/messages.mdx new file mode 100644 index 0000000000..7b04a32388 --- /dev/null +++ b/src/pages/docs/api/realtime-sdk/messages.mdx @@ -0,0 +1,109 @@ +--- +title: Messages +meta_description: "Realtime Client Library SDK API reference section for the message object." +meta_keywords: "Ably, Ably realtime, API Reference, Realtime SDK, message, messages" +redirect_from: + - /docs/api/versions/v1.1/realtime-sdk/messages + - /docs/api/versions/v1.0/realtime-sdk/messages + - /docs/api/versions/v0.8/realtime-sdk/messages +--- + +## PropertiesAttributesMembers + +A `Message` represents an individual message that is sent to or received from Ably. + +### nameName + +The event name, if provided.
_Type: `String`_ + +### dataData
+ +The message payload, if provided.
_Type: `String`, `StringBuffer`, `JSON Object``String`, `ByteArray`, `JSONObject`, `JSONArray``String`, `byte[]`, `plain C# object that can be serialized to JSON``String`, `Binary` (ASCII-8BIT String), `Hash`, `Array``NSString *`, `NSData *`, `NSDictionary *`, `NSArray *``String`, `NSData`, `Dictionary`, `Array``String`, `Map`, `List`_ + +### extrasExtras
+ +Metadata and/or ancillary payloads, if provided. Valid payloads include [`push`](/docs/push/publish#payload), [`headers`](/docs/channels#metadata) (a map of strings to strings for arbitrary customer-supplied metadata), [`ephemeral`](/docs/pub-sub/advanced#ephemeral), and [`privileged`](/docs/platform/integrations/webhooks#skipping).
_Type: `JSONObject`, `JSONArray`plain C# object that can be converted to JSON`JSON Object``Hash`, `Array``Dictionary`, `Array``NSDictionary *`, `NSArray *`_ + +### idId
+ +A Unique ID assigned by Ably to this message.
_Type: `String`_ + +### clientIdClientIdclient_id
+ +The client ID of the publisher of this message.
_Type: `String`_ + +### connectionIdConnectionIdconnection_id
+ +The connection ID of the publisher of this message.
_Type: `String`_ + +### connectionKeyConnectionKeyconnection_key
+ +A connection key, which can optionally be included for a REST publish as part of the [publishing on behalf of a realtime client functionality](/docs/pub-sub/advanced#publish-on-behalf).
_Type: `String`_ + +### timestampTimestamp
+ +Timestamp when the message was first received by the Ably, as milliseconds since the epocha `Time` object.
_Type: `Integer``Long Integer``DateTimeOffset``Time``NSDate`_ + +### encodingEncoding
+ +This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the `data` payload.
_Type: `String`_ + + + +### action
+ +The action type of the message, one of the [`MessageAction`](/docs/api/realtime-sdk/types#message-action) enum values.
_Type: `int enum { MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, META, MESSAGE_SUMMARY }`_ + +### serial
+ +A server-assigned identifier that will be the same in all future updates of this message. It can be used to add annotations to a message. Serial will only be set if you enable annotations in [channel rules](/docs/channels#rules).
_Type: `String`_ + +### annotations
+ +An object containing information about annotations that have been made to the object.
_Type: [`MessageAnnotations`](/docs/api/realtime-sdk/types#message-annotations)_ + + + +### Message constructors
+ +#### Message.fromEncoded + +`Message.fromEncoded(Object encodedMsg, ChannelOptions channelOptions?) -> Message` + +A static factory method to create a [`Message`](/docs/api/realtime-sdk/types#message) from a deserialized `Message`-like object encoded using Ably's wire protocol. + +##### Parameters + +| Parameter | Description | Type | +|-----------|-------------|------| +| encodedMsg | A `Message`-like deserialized object. | `Object` | +| channelOptions | An optional [`ChannelOptions`](/docs/api/realtime-sdk/types#channel-options). If you have an encrypted channel, use this to allow the library can decrypt the data. | `Object` | + +##### Returns + +A [`Message`](/docs/api/realtime-sdk/types#message) object + +#### Message.fromEncodedArray + +`Message.fromEncodedArray(Object[] encodedMsgs, ChannelOptions channelOptions?) -> Message[]` + +A static factory method to create an array of [`Messages`](/docs/api/realtime-sdk/types#message) from an array of deserialized `Message`-like object encoded using Ably's wire protocol. + +##### Parameters + +| Parameter | Description | Type | +|-----------|-------------|------| +| encodedMsgs | An array of `Message`-like deserialized objects. | `Array` | +| channelOptions | An optional [`ChannelOptions`](/docs/api/realtime-sdk/types#channel-options). If you have an encrypted channel, use this to allow the library can decrypt the data. | `Object` | + +##### Returns + +An `Array` of [`Message`](/docs/api/realtime-sdk/types#message) objects + +## MessageAnnotations + +#### PropertiesMembersAttributes + +| Property | Description | Type | +|----------|-------------|------| +| summary | An object whose keys are annotation types, and the values are aggregated summaries for that annotation type | `Record` |