Choose where you’d like to start

Post to Channel

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.

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

Syntax

<variable> = zoho.cliq.postToChannel(<channel_name>, <message>, <connection>);

where,

ParamsData typeDescription

<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.

Note: File and List of File data types are not supported when this task is used in Zoho Creator.

<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 bot.
  • 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 channel - DelugeChannel.

response = zoho.cliq.postToChannel("DelugeChannel", "Hello", "cliq_connection");

(or)

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

where,

response
is 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

  • 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

Get Started Now

Execute