You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieves the latest version of a specific message by its serial identifier. Requires the **history**[capability](/docs/auth/capabilities).
844
848
845
849
See [updating and deleting messages: retrieving the latest version](/docs/messages/updates-deletes#get) for more information.
@@ -878,6 +882,18 @@ Returns a [`Message`](/docs/api/realtime-sdk/messages) object representing the l
878
882
On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-exception).
879
883
</If>
880
884
885
+
<Iflang="swift">
886
+
| Parameter | Description | Type |
887
+
|-----------|-------------|------|
888
+
| serial | A serial identifier string of the message to retrieve |`String`|
889
+
| callback | A success or failure callback function. On success, it receives an [`Message`](/docs/api/realtime-sdk/messages) object representing the latest version of the message | - |
890
+
891
+
##### Callback result
892
+
On success, the callback receives a [`Message`](/docs/api/realtime-sdk/messages) object representing the latest version of the message.
893
+
894
+
On failure, the callback receives an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error.
895
+
</If>
896
+
881
897
#### updateMessage
882
898
883
899
<Iflang="javascript,nodejs">
@@ -892,16 +908,39 @@ On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-except
Publishes an update to an existing message with shallow mixin semantics. Non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-update-own** or **message-update-any**[capability](/docs/auth/capabilities).
896
916
917
+
<Iflang="swift">
918
+
Note: Note that this publishes an update, it does not mutate the original message if passed in.
919
+
</If>
920
+
897
921
See [updating and deleting messages: updates](/docs/messages/updates-deletes#update) for more information.
898
922
899
923
##### Parameters
900
924
925
+
<Iflang="javascript,nodejs,java,python">
926
+
927
+
| Parameter | Description | Type |
928
+
|-----------|-------------|------|
929
+
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the fields to update |[`Message`](/docs/api/realtime-sdk/messages)|
930
+
| operation | An optional `MessageOperation` object containing metadata about the update operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
931
+
932
+
</If>
933
+
934
+
<Iflang="swift">
935
+
901
936
| Parameter | Description | Type |
902
937
|-----------|-------------|------|
903
938
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the fields to update |[`Message`](/docs/api/realtime-sdk/messages)|
904
939
| operation | An optional `MessageOperation` object containing metadata about the update operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
940
+
| params | Optional parameters sent as part of the request. As Ably adds supported parameters, they will be documented on the [docs pages](https://ably.com/docs)|`[String: Stringifiable]` (optional) |
941
+
| callback | A success or failure callback function. On success, it receives an `UpdateDeleteResult` object containing the new version of the message | (optional) |
942
+
943
+
</If>
905
944
906
945
<Iflang="javascript,nodejs">
907
946
##### Returns
@@ -923,6 +962,14 @@ Returns an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-res
923
962
On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-exception).
924
963
</If>
925
964
965
+
<Iflang="swift">
966
+
##### Callback result
967
+
968
+
On success, the callback receives an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message.
969
+
970
+
On failure, the callback receives an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error.
971
+
</If>
972
+
926
973
#### deleteMessage
927
974
928
975
<Iflang="javascript,nodejs">
@@ -937,16 +984,35 @@ On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-except
Marks a message as deleted by publishing an update with an action of `MESSAGE_DELETE`. This does not remove the message from the server, and the full message history remains accessible. Uses shallow mixin semantics: non-null `name`, `data`, and `extras` fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged. Requires the **message-delete-own** or **message-delete-any**[capability](/docs/auth/capabilities).
941
992
942
993
See [updating and deleting messages: deletes](/docs/messages/updates-deletes#delete) for more information.
943
994
944
995
##### Parameters
945
996
997
+
<Iflang="javascript,nodejs,java,python">
998
+
999
+
| Parameter | Description | Type |
1000
+
|-----------|-------------|------|
1001
+
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field |[`Message`](/docs/api/realtime-sdk/messages)|
1002
+
| operation | An optional `MessageOperation` object containing metadata about the delete operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
1003
+
1004
+
</If>
1005
+
1006
+
<Iflang="swift">
1007
+
946
1008
| Parameter | Description | Type |
947
1009
|-----------|-------------|------|
948
1010
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field |[`Message`](/docs/api/realtime-sdk/messages)|
949
1011
| operation | An optional `MessageOperation` object containing metadata about the delete operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
1012
+
| params | Optional parameters sent as part of the request. As Ably adds supported parameters, they will be documented on the [docs pages](https://ably.com/docs)|`[String: Stringifiable]` (optional) |
1013
+
| callback | A success or failure callback function. On success, it receives an `UpdateDeleteResult` object containing the new version of the message | (optional) |
1014
+
1015
+
</If>
950
1016
951
1017
<Iflang="javascript,nodejs">
952
1018
##### Returns
@@ -968,6 +1034,14 @@ Returns an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-res
968
1034
On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-exception).
969
1035
</If>
970
1036
1037
+
<Iflang="swift">
1038
+
##### Callback result
1039
+
1040
+
On success, the callback receives an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message.
1041
+
1042
+
On failure, the callback receives an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error.
1043
+
</If>
1044
+
971
1045
#### appendMessage
972
1046
973
1047
<Iflang="javascript,nodejs">
@@ -982,16 +1056,35 @@ On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-except
Appends data to an existing message. The supplied `data` field is appended to the previous message's data, while all other fields (`name`, `extras`) replace the previous values if provided. Requires the **message-update-own** or **message-update-any**[capability](/docs/auth/capabilities).
986
1064
987
1065
See [updating and deleting messages: appends](/docs/messages/updates-deletes#append) for more information.
988
1066
989
1067
##### Parameters
990
1068
1069
+
<Iflang="javascript,nodejs,java,python">
1070
+
1071
+
| Parameter | Description | Type |
1072
+
|-----------|-------------|------|
1073
+
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the data to append |[`Message`](/docs/api/realtime-sdk/messages)|
1074
+
| operation | An optional `MessageOperation` object containing metadata about the append operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
1075
+
1076
+
</If>
1077
+
1078
+
<Iflang="swift">
1079
+
991
1080
| Parameter | Description | Type |
992
1081
|-----------|-------------|------|
993
1082
| message | A [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field and the data to append |[`Message`](/docs/api/realtime-sdk/messages)|
994
1083
| operation | An optional `MessageOperation` object containing metadata about the append operation. Can include `clientId`, `description`, and `metadata` fields |`MessageOperation` (optional) |
1084
+
| params | Optional parameters sent as part of the request. As Ably adds supported parameters, they will be documented on the [docs pages](https://ably.com/docs)|`[String: Stringifiable]` (optional) |
1085
+
| callback | A success or failure callback function. On success, it receives an `UpdateDeleteResult` object containing the new version of the message | - |
1086
+
1087
+
</If>
995
1088
996
1089
<Iflang="javascript,nodejs">
997
1090
##### Returns
@@ -1013,6 +1106,14 @@ Returns an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-res
1013
1106
On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-exception).
1014
1107
</If>
1015
1108
1109
+
<Iflang="swift">
1110
+
##### Callback result
1111
+
1112
+
On success, the callback receives an [`UpdateDeleteResult`](/docs/api/realtime-sdk/types#update-delete-result) object containing the new version of the message.
1113
+
1114
+
On failure, the callback receives an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object which explains the error.
1115
+
</If>
1116
+
1016
1117
#### getMessageVersions
1017
1118
1018
1119
<Iflang="javascript,nodejs">
@@ -1027,17 +1128,34 @@ On failure, raises an [`AblyException`](/docs/api/realtime-sdk/types#ably-except
Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations. Requires the **history**[capability](/docs/auth/capabilities).
1031
1136
1032
1137
See [updating and deleting messages: message versions](/docs/messages/updates-deletes#versions) for more information.
1033
1138
1034
1139
##### Parameters
1035
1140
1141
+
<Iflang="javascript,nodejs,java,python">
1142
+
1036
1143
| Parameter | Description | Type |
1037
1144
|-----------|-------------|------|
1038
1145
| serialOrMessage | Either the serial identifier string of the message whose versions are to be retrieved, or a [`Message`](/docs/api/realtime-sdk/messages) object containing a populated `serial` field |`string` or [`Message`](/docs/api/realtime-sdk/messages)|
1039
1146
| params | Optional parameters sent as part of the query string | <Iflang="javascript,nodejs">`Record<string, any>`</If><Iflang="java">`Param[]`</If> (optional) |
1040
1147
1148
+
</If>
1149
+
1150
+
<Iflang="swift">
1151
+
1152
+
| Parameter | Description | Type |
1153
+
|-----------|-------------|------|
1154
+
| serial | A serial identifier string of the message whose versions are to be retrieved |`String`|
1155
+
| callback | A success or failure callback function. On success, it receives an [`PaginatedResult`](#paginated-result) object containing an array of [`Message`](#message) objects representing all versions of the message. | - |
1156
+
1157
+
</If>
1158
+
1041
1159
<Iflang="javascript,nodejs">
1042
1160
##### Returns
1043
1161
@@ -1052,6 +1170,13 @@ On success, the returned [`PaginatedResult`](#paginated-result) encapsulates an
1052
1170
Failure to retrieve the message versions will raise an [`AblyException`](/docs/api/realtime-sdk/types#ably-exception)
1053
1171
</If>
1054
1172
1173
+
<Iflang="swift">
1174
+
##### Callback result
1175
+
1176
+
On success, the callback receives a [`PaginatedResult`](#paginated-result) encapsulating an array of [`Message`](#message) version objects corresponding to the current page of results. [`PaginatedResult`](#paginated-result) supports pagination using [`next()`](#paginated-result) and [`first()`](#paginated-result) methods.
1177
+
1178
+
On failure to retrieve message versions, the callback receives an [`ErrorInfo`](/docs/api/realtime-sdk/types#error-info) object with the failure reason.
0 commit comments