Choose where you’d like to start

Edit Message

Note: This task is applicable to all Zoho Services, except Zoho Creator.

Description

This task is used to edit a message in Zoho Cliq.

This task is based on Zoho Cliq API - Edit a message.

Syntax

<variable> = zoho.cliq.editMessage(<chat_ID>, <message_ID>, <updated_message>, <connection>);

where,

ParameterData typeDescription

<variable>

KEY-VALUE

is the variable which will hold the response returned by Zoho Cliq.

<chat_id>

TEXT (or) NUMBER

is the chat ID of the recipient's chat in which the message to be updated exists.

<message_id>

TEXT

is the ID of the message which will be updated.

The message ID can be retrieved by clicking on the three dotted icon for the message in Zoho Cliq and copying the message URL.

Sample message URL: 
https://cliq.zoho.com/chats/<chatID>/messages/<messageID>

The ID of a message can also be retrieved by creating a Message Action with the following script:

info message.get("id");

<updated_message>

TEXT
KEY-VALUE

is the updated message.

Key-value must be in the format: {"text" : "<updated_message>"}. When using key-value format, an additional key "notify_edit" can be used to notify the chat recipient of the edit.

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 - Edit a message.
  • 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.editMessage("22306xxxxxxxxxx6126","159xxxxxxxx97_3354xxxxxxxx396","Hello", "cliq_connection");

(or)

response = zoho.cliq.editMessage("22306xxxxxxxxxx6126","159xxxxxxxx97_3354xxxxxxxx396",{"text":"Hello"}, "cliq_connection");

where,

response
is a KEY-VALUE response returned by Zoho Cliq, that represents the status of the executed task
"22306xxxxxxxxxx6126"
is a TEXT that represents the chat ID of the recipient
""159xxxxxxxx97_3354xxxxxxxx396""
is a TEXT that represents the ID of the message which will be edited
"text"
is the key of TEXT data type which represents the updated message
"Hello"
is the updated TEXT message
"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"}

  • The failure response returned due to incorrect chat ID is of the following format.

    {"code":"operation_failed"}

  • The failure response returned due to incorrect message ID 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

Get Started Now

Execute