REST SDK Channels
Single channel
const result = await rest.channels.get("notifications").publish(
{ text: "Hello" },
{ event: "greeting", alias: "api" }
);
Maps to POST /v1/channel/notifications/messages.
Batch
await rest.channels.publishBatch(
["notifications", "ops"],
[
{ data: { text: "Hello" }, event: "greeting" },
{ data: { text: "Again" }, event: "greeting" },
]
);
Maps to POST /v1/channels/messages with a channels array.
Auth
Uses rest.auth.getAuthHeaders() (Bearer JWT if present, otherwise Basic API key).
Previous
REST SDK
Next
Queues