Channels append

Open in

Use the ably channels append command to append data to a message on an Ably Pub/Sub channel.

Synopsis

ably channels append <channel-name> <message-serial> <message> [options]

Arguments

channel-name
Required

The name of the channel containing the message.

message-serial
Required

The serial of the message to append data to.

message
Required

The data to append. This can be plain text or JSON.

Options

--description

A description for the appended data.

--encoding | -e

The encoding of the message, such as json/utf-8.

--name | -n

The event name for the appended message.

--client-id

A client ID to use when appending the message.

--json

Output results as compact JSON. Mutually exclusive with --pretty-json.

--pretty-json

Output results in formatted JSON. Mutually exclusive with --json.

--verbose | -v

Enable verbose logging. Can be combined with --json or --pretty-json.

Examples

Append data to a message:

ably channels append my-channel "msg-serial" '{"extra": "data"}'

Append with an event name:

ably channels append my-channel "msg-serial" "additional info" --name update

Append with a description:

ably channels append my-channel "msg-serial" '{"note": "correction"}' --description "Added correction"

Append plain text data to a message:

ably channels append my-channel "msg-serial" "Appended plain text"

Append data and output the result in JSON format:

ably channels append my-channel "msg-serial" '{"data":"appended"}' --json

Append data and output the result in formatted JSON:

ably channels append my-channel "msg-serial" '{"data":"appended"}' --pretty-json

See also

  • Channels — Explore all ably channels commands.
  • CLI reference — Full list of available commands.