Post to Channel
Table of Contents
Overview
This task is used to post a message to any of the channels that you are a part of, using the channel name in Zoho Cliq.
Syntax
<variable> = zoho.cliq.postToChannel(<channel_name>, <message>, <connection>);
where,
Params | Data type | Description |
<variable> | KEY-VALUE | is the variable which will hold the response returned by Zoho Cliq. |
<channel_name> | TEXT | is the channel's name in which the message will be posted. |
<message> | TEXT | is the message to be posted. The different types of content that can be posted in a channel can be found here. |
<connection>* (optional) | TEXT | specifies the name of the Zoho Cliq connection. *Note: This param is mandatory in all services except Zoho Cliq, and not applicable to Zoho Creator. |
Example
The following script posts a message Hello in the channel - DelugeChannel.
response = zoho.cliq.postToChannel("DelugeChannel", "Hello", "cliq_connection");
(or)
response = zoho.cliq.postToChannel("DelugeChannel", {"text":"Hello"}, "cliq_connection");
where,
response
"DelugeChannel"
"text"
"Hello"
"cliq_connection"
Response Format
Following is a sample success response:
{"status":"success"The failure response returned for a non-existent channel name is of the following format.
{
"message":"Whoa! Looks like this channel does not exist.",
"code":"channel_not_exists"
}