Post to channel as admin
Table of Contents
Note:
- Each time the zoho.cliq.postToChannelAsAdmin integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.cliq.postToChannelAsAdmin integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
This task is used to post a message as an admin to any of the channels that you are a part of, using the channel name in Zoho Cliq. The channel members will receive your message in the channel and the sender will be displayed as admin.
This task is based on Zoho Cliq API - Post message in a channel.
Syntax
<variable> = zoho.cliq.postToChannelAsAdmin(<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 KEY-VALUE FILE LIST of FILE | is the message to be posted. The different types of content that can be posted in a channel can be found here. |
| <connection> | TEXT | specifies the link name of the Zoho Cliq connection. Note:
|
Example
The following script posts a message Hello as an admin in the channel - DelugeChannel.
response = zoho.cliq.postToChannelAsAdmin("DelugeChannel","Hello", "cliq_connection");
(or)
response = zoho.cliq.postToChannelAsAdmin("DelugeChannel",{"text":"Hello"}, "cliq_connection");
where,
responseis a KEY-VALUE response returned by Zoho Cliq, that represents the status of the executed task
"DelugeChannel"is a TEXT that represents channel name
"text"is the key of TEXT data type which represents the message to be posted
"Hello"is the TEXT message to be posted
"cliq_connection"is the TEXT that represents the name of the connection
Response Format
The 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"
}
Related Links
- Zoho Cliq API
- Common error codes can be viewed here