Post to Bot as an admin
Table of Contents
Note: This task is applicable to all Zoho Services, except Zoho Creator.
Overview
This task is used to post a message as an admin to any of the bots that you have subscribed, using the bot name in Zoho Cliq. The bot subscribers will receive your message and the sender will be displayed as admin.
This task is based on Zoho Cliq API - Post message to a bot.
Syntax
<variable> = zoho.cliq.postToBotAsAdmin(<bot_name>, <message>, <connection>);
where,
Params | Data type | Description |
<variable> | KEY-VALUE | is the variable which will hold the response returned by Zoho Cliq. |
<bot_name> | TEXT | is the bot'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 bot is found here. |
<connection> | TEXT | specifies the link name of the Zoho Cliq connection. Note:
|
Example
The following script posts a message Hello in the Bot - ZohoDeluge as an admin.
response = zoho.cliq.postToBotAsAdmin("ZohoDeluge", "Hello", "cliq_connection");
(or)
response = zoho.cliq.postToBotAsAdmin("ZohoDeluge",{"text":"Hello"}, "cliq_connection");
where,
response
"ZohoDeluge"
"text"
"Hello"
"cliq_connection"
Sample Response
The following is a sample success response:
{"users":["666667777"]}The failure response returned for an incorrect Bot name is of the following format.
{
"message":"Sorry, we couldn't process your request due to a technical error. Please try again later.",
"code":"operation_failed"
}
Related Links
- Common error codes can be viewed here