Publish an annotation removal request for a message, to remove it from the message's annotation summary. The semantics of a delete, and the fields it requires, differ by annotation type.
It sets action to annotation.delete on the annotation object you pass, overwriting any action you set.
The supplied Message must carry a populated serial. A newly constructed Message has none, so the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule, and the key or token must have the annotation-publish capability. Without either the server rejects the operation, so the call rejects with an ErrorInfo.
The message which has an annotation that you want to delete.
The annotation deletion request. It must include at least the type. Other required fields depend on the type.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
await channel.annotations.delete(message, { type: 'emoji:distinct.v1', name: '👍' });
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-delete
Publish an annotation removal request for a message, to remove it from the message's annotation summary. The semantics of a delete, and the fields it requires, differ by annotation type.
It sets action to annotation.delete on the annotation object you pass, overwriting any action you set.
The supplied serial must be a non-empty string, otherwise the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule, and the key or token must have the annotation-publish capability. Without either the server rejects the operation, so the call rejects with an ErrorInfo.
The serial field of the message which has an annotation that you want to delete.
The annotation deletion request. It must include at least the type. Other required fields depend on the type.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
await channel.annotations.delete(messageSerial, { type: 'emoji:distinct.v1', name: '👍' });
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-delete
Get all annotations for a given message.
The supplied Message must carry a populated serial. A newly constructed Message has none, so the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule. Without it the call rejects with an ErrorInfo.
The message to get annotations for.
Restrictions on which annotations to get, in particular a limit.
A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of Annotation objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.
const result = await channel.annotations.get(message, null);
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-get
Get all annotations for a given message.
The supplied serial must be a non-empty string, otherwise the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule. Without it the call rejects with an ErrorInfo.
The serial of the message to get annotations for.
Restrictions on which annotations to get, in particular a limit.
A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of Annotation objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.
const result = await channel.annotations.get(messageSerial, null);
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-get
Publish a new annotation for a message. If the annotation specifies no action, it defaults to annotation.create.
The supplied Message must carry a populated serial. A newly constructed Message has none, so the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule, and the key or token must have the annotation-publish capability. Without either the server rejects the operation, so the call rejects with an ErrorInfo.
Annotation data is never encrypted, even when cipher is set, because the server must be able to read it to build summaries.
The message to annotate.
The annotation to publish. It must include at least the type. Other required fields depend on the annotation type.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
await channel.annotations.publish(message, { type: 'emoji:distinct.v1', name: '👍' });
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-publish
Publish a new annotation for a message. If the annotation specifies no action, it defaults to annotation.create.
The supplied serial must be a non-empty string, otherwise the call rejects with an ErrorInfo.
Message annotations must be enabled for the channel's namespace by a rule, and the key or token must have the annotation-publish capability. Without either the server rejects the operation, so the call rejects with an ErrorInfo.
Annotation data is never encrypted, even when cipher is set, because the server must be able to read it to build summaries.
The serial field of the message to annotate.
The annotation to publish. It must include at least the type. Other required fields depend on the annotation type.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
await channel.annotations.publish(messageSerial, { type: 'emoji:distinct.v1', name: '👍' });
https://ably.com/docs/pub-sub/api/javascript/rest/rest-annotations#annotations-publish
Generated using TypeDoc
Functionality for annotating messages with small pieces of data, such as emoji reactions, that the server will roll up into the message as a summary.