×îв©²ÊÍøÕ¾

Choose where you’d like to start

Post to Bot

Overview

This task is used to post a message to any of the bots that you have subscribed, using the bot name in ×îв©²ÊÍøÕ¾ Cliq. The chat will be displayed to all the bot subscribers if you are the admin, otherwise the chat will be visible only to you.

This task is based on ×îв©²ÊÍøÕ¾ Cliq API - Post message to a bot

Syntax

<variable> = zoho.cliq.postToBot(<bot_name>, <message>, <connection>);

where,

ParamsData typeDescription

<variable>

KEY-VALUE

is the variable which will hold the response returned by ×îв©²ÊÍøÕ¾ Cliq.

<bot_name>

TEXT

is the bot'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 bot can be found here.

Note: File and List of File data types are not supported when this task is used in ×îв©²ÊÍøÕ¾ Creator.

<connection>

TEXT 

specifies the link name of the ×îв©²ÊÍøÕ¾ Cliq .

Note:

  • In view of , a ×îв©²ÊÍøÕ¾ OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from .
  • Add relevant scopes as mentioned in ×îв©²ÊÍøÕ¾ Cliq API - Delete a record.
  • Refer to  for the list of ×îв©²ÊÍøÕ¾ services that support the connections page.
  • Learn more about connections

Example

The following script posts a message Hello in the Bot - ×îв©²ÊÍøÕ¾Deluge.

response = zoho.cliq.postToBot("×îв©²ÊÍøÕ¾Deluge","Hello","cliq_connection");

(or)

response = zoho.cliq.postToBot("2230642502702656126",{"text":"Hello"}, "cliq_connection");

where,

response
is the variable which will hold the KEY-VALUE response returned by ×îв©²ÊÍøÕ¾ Cliq, that represents the ZUID of the executed task
"×îв©²ÊÍøÕ¾Deluge"
is a TEXT that represents Bot name
"text"
is the key of TEXT data type which represents the message to be posted
"Hello"
is a TEXT message to be posted
"cliq_connection"
is the TEXT that represents the name of the connection

Sample Response

  • The following is a sample success response:

    {"users":["666667777"]}
  • The following is a sample failure response:

    {
    "message":"Sorry, we couldn't process your request due to a technical error. Please try again later.",
    "code":"operation_failed"
    }

Related Links

Get Started Now