Cliq Bots - Post message to a bot using the command line!

Cliq Bots - Post message to a bot using the command line!

If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how to send a message to your bot and broadcast it to all your bot subscribers through a simple command. 

We'll be looking at how to post a message to the bot using cURL, Wget and PowerShell. The steps are pretty straight forward. You'll need the following:
  1. Create a bot
  2. Generate a webhook token
  3. Form your message as a JSON
  4. Post your message to the bot's messaging endpoint
  5. And done
Get started by creating a bot 
 
Get started with creating your bot, if you haven't already! You can refer our help page on bot creation. Once you've created the bot, take note of the bot's endpoint URL in the bot preview page. You can find the bot preview page by following the below steps:
  1. Click on Settings and choose Integrations.
  2. Select Bots in the Integrations page. 
  3. Select which ever bot you would like to send a message to and click on the bot's name. The bot's preview page is displayed. 
The example here is for the Zylker Help Bot. The bot's API End Point URL is https://cliq.zoho.com/api/v2/bots/cliqhelpbot/message



Webhook tokens

Webhook tokens are unique authentication keys specific to a user. These tokens can be used to connect with third party applications through webhooks, in order to post messages to a channel or chat.
      To use the Messaging API you'll need Cliq's webhook tokens.These tokens will provide you with authentication to access the message APIs. Follow the given steps to generate your own webhook:
  1. In Cliq, click on your profile in the top right corner and choose -> Bots & tools 
  2. Now, in the integrations page click on Webhook tokens at the bottom left
  3. Click on the button Generate new token to generate your webhook token

To know more about webhooks click on the following link:

Structure your message as a JSON

We have an easy way to build cool message card templates. The message structure shown below is built using our Message Builder. Here, we're trying to notify all the bot's subscribers. This can be done using the broadcast parameter. When broadcast is true, message is posted to all subscribers of the bot! More details about this parameter and the other parameters are explained in our How to post message to a bot section. 
  1. {

  2. "text": "This seems to be the easiest way to post a message to a bot! ",
  3. // The broadcast param is used to send message to all the bot subscribers. 
  4. "broadcast" :"true",

  5. "card": {

  6. "title": "Hi Guys!",

  7. "thumbnail": "https://media.giphy.com/media/3o6ZtpxSZbQRRnwCKQ/giphy.gif",

  8. "theme": "prompt"

  9. }

  10. }

And finally, posting the message! 

We'll be sending the message through a standard POST request. 

Take a look at how to make the request via curl :
  1. curl -X POST -H "Content-type:application/json"https://cliq.zoho.com/api/v2/bots/zylkerhelpbot/message?zapikey=1001.2798931fdf4905dc5d37806b47d8253a.2d73063dae2ccf4a04810ddxxxxxxxxxx-d '{
  2. "text": "This seems to be the easiest way to post a message to a bot! ",
  3. "broadcast" :"true",
  4. "card": {
  5. "title": "Hi Guys!",
  6. "thumbnail": "https://media.giphy.com/media/3o6ZtpxSZbQRRnwCKQ/giphy.gif",
  7. "theme": "prompt"
  8. }
  9. }'

Similarly, the same request using Wget :
  1. wget --post-data="{
  2. 'text': 'This seems to be the easiest way to post a message to a bot!',
  3. 'broadcast' :'true',
  4. 'card': {
  5. 'title': 'Hi Guys!',
  6. 'thumbnail': 'https://media.giphy.com/media/3o6ZtpxSZbQRRnwCKQ/giphy.gif',
  7. 'theme': 'prompt'
  8. }
  9. }" --header="Content-type:application/json" https://cliq.zoho.com/api/v2/bots/zylkerhelpbot/message?zapikey=1001.2798931fdf4905dc5d37806b47d8253a.2d73063dae2ccf4a04810ddxxxxxxxxx

Finally, PowerShell for all you Windows people out there!
  1. Invoke-RestMethod -Uri https://cliq.zoho.com/api/v2/bots/zylkerhelpbot/message?zapikey=1001.2798931fdf4905dc5d37806b47d8253a.2d73063dae2ccf4a04810ddxxxxxxxxxx -Method Post -ContentType 'application/json' -Body '{
  2. "text": "This seems to be the easiest way to post a message to a bot! ",
  3. "broadcast" :"true",
  4. "card": {
  5. "title": "Hi Guys!",
  6. "thumbnail": "https://media.giphy.com/media/3o6ZtpxSZbQRRnwCKQ/giphy.gif",
  7. "theme": "prompt"
  8. }
  9. }'
The message posted will look like the message card shown in the image below. 




How about trying these right away? All you've to do is replace the webhook token with yours and give your bot's unique name in the script. Get started now and tell the world how easy it indeed is! Comments and suggestions are welcome.

Best,
Manasa
Cliq 
    • Sticky Posts

    • Cliq Bots - Post message to a bot using the command line!

      If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
    • Automate a CRM workflow with Zoho Cliq

      Imagine having a virtual assistant that provides rapid updates to your team through Zoho Cliq, helping you stay on top of your sales processes. After returning from a client meeting filled with updates and action items, managing this information together
    • Automating leave alerts in Zoho Cliq

      The constant ebb and flow of employee absences can disrupt projects and hinder productivity. With Zoho Cliq's leave alert automation, you can easily keep your team informed. Real-time notifications can be sent to team chats, ensuring that everyone stays
    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Convert a message on Cliq into a task on Zoho Connect

      Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
    • Recent Topics

    • Access demo forms other than developers in Zoho Creator 6

      Can zoho creator 6 users other than developers test forms in the development/stage? just want to see the form view. The current condition of the form is being released, and want to make changes. But the user wants to see the changes first before publishing
    • Bigin_Email Notification not being sent when a new lead is created

      I have a workflow in BIGIN set to send an email notification when a new lead is created via a webform (integrated with ZohoForm) The trigger is whenever a contact is "Create or Edit". Conditioning was applied for contacts which source is "Website" If
    • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

      Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
    • How to install Widget in inventory module

      Hi, I am trying to install a app into Sales Order Module related list, however there is no button allow me to do that. May I ask how to install widget to inventory module related list?
    • Prevent subform editing on a module's detail's page

      Hi everyone, We would like to prevent any editing of the subform data in the : Create page Edit page Details page (as subform editing is now allowed by the recent UX update) We are able to prevent editing by making the subform fields read only in the
    • I'm so confused by the new (?) look

      I've been off Notebook for a long time, neglecting the app and never visiting the website. I decided to renew my commitment to it. It looks completely different! When I logged on before (app or browser page) I'd see a very pretty display of my multiple
    • Custom CSS in Zoho Form

      Hi, Please let me know, how we can add custom css in Zoho Form.  Thanks
    • Deluge Script to Reopen Ticket if Tasks are not Completed

      I have the following script, my goal is to have it automatically reopen the ticket when the ticket is closed if there are Activities assigned to the ticket that are not "Completed". This script seems to reopen the ticket if there are any tasks at all,
    • Zoho Desk & Tasks

      Hi, I'd like to be able to create a set of tasks each time a customer request comes in, as I understand it, currently each would need to be create manually. Project is too much of an overhead for what we want to use. Effectively in various use cases we
    • Export all Zoho desk tickets for past 3 months

      Hi I need to export ticket data from Zoho Desk. Specifically, I'm looking to: Export the last 3 months of tickets⁠ include ticket categories, timestamps, resolutions, agent responses (basically as much data as possible) the ticket content being the most
    • Zoho CRM <> Zoho Desk Account Sync

      I have had custom fields in Zoho CRM for a time and would like that data to sync to Zoho Desk. However, since the accounts are all synced to Zoho Desk already, the newly mapped fields are not updating in Zoho Desk. Is there a way to force the sync to
    • Count Function in Zoho Table

      Hi Zoho Team, Hope you're doing well. We would like to request the addition of a Count function in Zoho Table, similar to what exists in Excel, Google Sheets, and Airtable. Currently, there is no built-in way to count the occurrences of unique values
    • Configuring ZMA Webhook for Zoho Flow : Missing Key Information Error

      I'm looking to send a webhook to Zoho Flow at the end of a Marketing Automation journey in order to perform more actions that I can't do with just a journey. I have the Webhook created in Flow and set up in ZMA, however when I test it I get the error
    • Zoho Billing Record Refund vs Refund

      When looking at a paid invoice, the payment record can be viewed. In the more actions, there is a "Record Refund" option. If you click the payment referernce you see a "Refund" option. They bring up different forms. It appears as if "Record Refund" is
    • Emoticons to Slack in Zoho Flow

      When using the Slack integration in Zoho Flow, is there a way to send emoticons in the message? When I tried :emoticon: it didn't translate it to the emoticon.
    • Unified WhatsApp Number Management in Zoho Desk and SalesIQ

      Dear Zoho Desk Support Team, We are currently utilizing both Zoho Desk and Zoho SalesIQ for our customer support operations. While both platforms offer WhatsApp integration, we are facing challenges due to the requirement of separate WhatsApp numbers
    • Set connection link name from variable in invokeurl

      Hi, guys. How to set in parameter "connection" a variable, instead of a string. connectionLinkName = manager.get('connectionLinkName').toString(); response = invokeurl [ url :"https://www.googleapis.com/calendar/v3/freeBusy" type :POST parameters:requestParams.toString()
    • How to set default filter to CRM integration field

      I have a products subform in my order form and I'm using the CRM integration field to connect the Products module from my CRM to this subform. I want to filter the data that is fetched to the field from the CRM based on a status field in the Products
    • Restore Report in Zoho Creator After Changing Report Type

      I created a report in Zoho Creator and have been using it regularly. While editing, I accidentally changed the report type, and all the fields disappeared from the report. I am using the development version, but I don’t want to revert all the changes
    • Zoho Creator Upcoming Updates - March 2025

      Hello everyone, We hope you’ve had the chance to explore Release Projection 1 for 2025! This month, we’re keeping up the momentum by bringing even more powerful features and enhancements to Zoho Creator. Here's what you can expect in March: App menu builder
    • Why can't you make a layout rule based on a lookup field?

      Hello :) I am wanting to build a layout rule based on the selection of a lookup field. I have 3 fields that I want to hide for all options, but only show one if the lookup is one of the 3 options needing the extra field. It doesn't seem to give me the
    • Client Script | Update - Introducing Subform Events and Actions

      Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
    • How to associate a document sent in Zoho Sign with an deal in the CRM?

      Hi, often documents are loaded in Zoho sign and sent for signature. These sometimes are linked to a deal in the Zoho CRM and would be nice to see the status of the document within the CRM. I am aware of the integration, but that assumes that the document
    • Why Sharing Rules do Not support relative date comparison???

      I am creating a Sharing Rule and simply want to share where "Last Day of Coverage" (Date field) is Greater than TODAY (Starting Tomorrow). However, sharing rules don't have the option to compare a date field to a relative date (like today), only to Static
    • How to add "Forever Free Plan" to existing mail lite plan?

      There's an offer for: "Up to five users, 5GB/User, 25MB attachment limit." I already have a mail lite plan. I really like zoho mail and would like this added but I can't seem to access it. Keeps redirecting me to my existing inbox when i click the o
    • i can't create other user with my lite plan

      hello, I have paid little plan and I have added two domains but each has its own user however zoho shows me this message You do not have enough licenses. Purchase the necessary licenses to add, invite or import users I don’t know why if I have another
    • Zoho Books & Zoho CRM - Funcionalidade do campo moeda

      Pessoal bom dia, O Zoho Books tem uma funcionalidade nos campos de moeda, que ao colar números decimais com vírgula ( , ), ele automaticamente transforma para o formato de ponto ( . ). Ex: R$ 2,50 --> R$ 2.50 Esse comportamento está disponível no Zoho
    • Does Mail Lite allow SMTP?

      I am looking to use SMTP access, however I am not sure what plan I have to purchase, please assist.
    • No image image comes out in the recipient when I sent an email

      Hello to the entire forum, when I send an email from Zoho, my profile picture does not come out. On the other hand, if you do, using Gmail accounts. How is it configured to leave ??? Thank you Greetings !!
    • Iphone receipt capture stopped working

      I have been having difficulty getting receipt capture to work on the iPhone app. I have been using a work around by taking a photo with my camera then uploading it into the app instead of taking the picture through the app. This adds way too much extra
    • cant receive emails

      I have checked the Dns and everything seems to be fine pls check the print screens attached below help me cause i need to solve this fast
    • Create View to See Tickets Closed within the last 3 days

      I'm trying to create a view in Zoho Desk that shows me "recently closed ticket," which I will define as tickets closed in the last 3 days. I want this view to update so that whenever I click to view it is recalculates and shows me tickets closed within 3 days from that moment. When I try to Create a view and use the criteria of "Ticket Closed Time" I have to specify a discrete time frame (on or before a specific date). It doesn't allow me to define time/date dynamically like I can do with date fields
    • ERROR 554 5.1.8 Sender Address Blocked code(554)

      We have an email with Zoho ( comercial@bruiser.com.br), but, when we try associate the account in GMAIL, the server shows this message:  554 5.1.8 Sender Address Blocked code(554) I see this error appear when the limits of returns exceded 10 messages,
    • Unable to send message;Reason:550 5.4.6 Unusual sending activity detected. Please try after sometime

      Hello i'm unable to send any email because i keep getting this error Unable to send message;Reason:550 5.4.6 Unusual sending activity detected. Please try after sometime i have literally sent less than 10 emails today i'm not sure why i'm getting this
    • IP Addresses for Whitelist

      Hi,  Where can I get a list of the IP addresses I need to whitelist for accessing Zoho Desk? TIA
    • Recording overpayment?

      So a customer just overpaid me and how do I record this? I can't enter an amount that is higher than the invoice amount. Eg. Invoice is $195 and he sent $200. He's a reccuring customer so is there a way to record so that he has a $5 advance for future invoice?
    • Rejected Accounts still listed for Deal

      Hello guys I have a approval process thats validate the Accounts in CRM The issue is even when a account is rejected you can open a deal with it It's not supposed to appear in the lookup field or the approval process become pointless Can you guys help
    • Zoho Rentals

      Team, Zoho Inventory provides great features for Retail Sales and Purchases. On a similar note, There are significant portion of Rental industry would be missed out, if not looked into. Can we have a Zoho Rentals which can integrate with Zoho Inventory? Thanks!
    • zet pack not working

      We are using the zet pack command to package our Zoho extension. However, after running the command, the extension gets packed, but the resulting package is empty. We've attached a screenshot for reference. Could you please assist us with resolving this
    • How can I view Help Center articles in 'Sandbox' mode?

      I have published some help center articles but when I try to preview the knowledge base page, it says 'We have no content to display'.
    • Next Page