Post to Chat

Note:

  • This task is applicable to all Zoho Services, except Zoho Creator.
  • Each time the zoho.cliq.postToChat 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.postToChat 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 to any member in your organization, using the recipient's chat ID in Zoho Cliq.

This task is based on Zoho Cliq API - Post message in a chat.

Syntax

<variable> = zoho.cliq.postToChat(<chat_ID>, <message>, <connection>);

where,

ParameterData typeDescription
<variable>KEY-VALUEis the variable which will hold the response returned by Zoho Cliq.
<chat_id>TEXT (or) NUMBERis the chat ID of the recipient.
<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 chat window can be found here.

<connection>TEXT 

specifies the link name of the Zoho Cliq connection.

Note:

  • In view of stopping new authtoken generation, a Zoho 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 accounts.
  • Add relevant scopes as mentioned in Zoho Cliq API - Post to chat.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example

The following script posts a message Hello, in the chat window of the intended recipient.

response = zoho.cliq.postToChat("2230642502702656126","Hello", "cliq_connection");

(or)

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

where,

response
is a KEY-VALUE response returned by Zoho Cliq, that represents the status of the executed task
"2230642502702656126"
is a TEXT that represents the chat ID of the recipient
"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

Sample Response

The success response returned is of the following format.

{"status":"success"}

Related Links