Message Details

Message Details Object

The Message Details object in Cliq is used to extend the functionality of a bot. It enables the bot to process the users' replies in a much more meaningful context. The message_details object is passed as an attribute to the Bot Mention Handler and Bot Message Handler.

 

Properties of the message_details object :

AttributeDescription
timeThe message sent time.
messageA JSON Object with details about the message.

 

The structure of the message JSON object differs depending on whether it is a Text, Link or Attachment.  

Properties of the message object type : text

AttributeDescription
replied_messageDetails of the message to which the current message is added as a reply.
typeThe type of message. For text messages, the type is 'text'.
textThe message content.
mentionsJSON Array of objects with details about the users or bots mentioned in the message.

 

Properties of replied_message object :

AttributeDescription
senderDetails of the sender
timeThe message sent time.
mentionsJSON Array of objects with details about the users or bots mentioned in the message.

 

 


{
    "time":1606715627231,
    "message":    
 	{ 
               "replied_message": 
   	              {
                             "sender":  
 			         {
                                       "name":"WorkDriveBot",
                                       "id":"b-1735998001178543591"
                                 },
                              "mentions":[],
                              "time":1606715211110,
                              "text":"hi",
                              "id":"1606715211110_614577765734",
                              "type":"text"
                        },
                "mentions":   
                    [
                        {
                           "last_name":"fisher",
                           "dname":"@scottfisher",
                           "id":"664347134",
                           "type":"user",
                           "first_name":"scott",
                           "email":"scott.fisher@zylker.com"
                         }
                    ],
                "text":"{@664347134
}",
                "type":"text"
          }
}

 

Properties of the message object type : attachment

AttributeDescription
fileJSON object containing details of the file shared
commentComment added to the attachment.
typeThe type of message. For attachments , the type is 'attachment'.

 

File object properties

AttributeDescription
nameName of the file
idUnique identifier for the file
typeMedia type of the file
urlDownload url of the file

 

 


{
     "time":1606715211041,
     "message": 
	{
            "file":  
		  {            
                           "name":"Pic1.png",
 	                   "id":"8cd900a44c807d6fb91a79468836cdb5f9e86edd77562c3da3c4eff8a3909340c25c9d9d14d5f86e4d9864e972ffa21",
                           "type":"image/png",
                           "url":"https://cliq.zoho.com/v2/attachments/177b28759ae32bb0fn882d5211f70a71520c7743472ee2ab1a8f6b
                                 43e3cd4d69080d4e807135f348cb87dcb143418a140d927334408228d4bc74408681a09b188f02b1e10a7abe6f6"
                   },
            "comment":"{@664347134}",            
            "type":"attachment"
          }
}

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocliq.com