postChannelsByChannelSendWithHttpInfo method
Send a message from your org's bot to one chat room
Delivers text, attachments and actions to one room on a connected chat transport — discord, slack, teams, telegram or whatsapp — and answers that transport's own receipt, the messageId it assigned and the Unix second it landed. An unknown channel is a 404. The body is the envelope's NARROW outbound projection: room, text, attachments, actions, replyTo and idempotency, and nothing else. Identity is not a field — the channel is the path segment and the sender is the caller's validated org — so a body carrying sender, account or channel is refused with 400 rather than having it silently dropped. room.id is required, and so is something to say: text, or at least one attachment. Requires a validated principal; 403 without one. The room must already belong to the caller's org — each transport verifies the binding itself, so a room this org has not bound is 403 and a room whose route the bot has never learned is 409, meaning someone has to message the bot there first. A route learned only so a pairing reply could be delivered lasts exactly as long as that pairing request does, so a room whose sender was never approved goes back to 409 within the hour. A transport that fails answers 502 carrying status and shape only, never a token. Sending is at-most-once only if you ask for it: pass an idempotency string and a replay answers 200 with the PRIOR receipt instead of sending twice, while a send that fails releases the key so the caller can re-attempt. Bodies over 1 MiB are refused. Every transport currently renders text only, so attachments and actions are flattened deterministically to one line each after the text rather than dropped.
Note: This method returns the HTTP Response.
Parameters:
- String channel (required):
Implementation
Future<Response> postChannelsByChannelSendWithHttpInfo(String channel,) async {
// ignore: prefer_const_declarations
final path = r'/v1/channels/{channel}/send'
.replaceAll('{channel}', channel);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}