Skip to main content

Send ephemeral message

Sends a message that arrives in the channel but is visible only to a specific user

Function SendEphemeralMessage(Val Token, Val Channel, Val Text = "", Val User = "", Val Blocks = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
Channel--channelStringChannel ID
Text--textStringMessage text
User--userStringUser ID
Blocks--blocksArray of StructureJSON array of block descriptions

Returns: Map Of KeyAndValue - serialized JSON response from Slack


1C:Enterprise/OneScript code example
    Token   = "xoxb-6965308400114-696804637...";
Channel = "C06UFNUTKUL";
User = "U06UABH3APP";
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
Text = "Ephemeral message";

Block = OPI_Slack.GenerateImageBlock(Image, "Image");
Result = OPI_Slack.SendEphemeralMessage(Token, Channel, Text, User, Block);
    # JSON data can also be passed as a path to a .json file

oint slack SendEphemeralMessage \
--token "***" \
--channel "C06UFNUTKUL" \
--text "Ephemeral message" \
--user "U06UABH3APP" \
--blocks "{'type':'image','image_url':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg','alt_text':'Image'}"
Result
{
"ok": true,
"message_ts": "1728454511.000300"
}