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

    • 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
    • Automate your status with Cliq Schedulers

      Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick
    • Bulk user onboarding for Cliq Channels in a jiffy

      As developers, we frequently switch between coding, debugging, and optimizing tasks. The last thing we want is to be burdened by manual user management. Adding users one by one to a channel is tedious and prone to errors, taking up more time than we could
    • 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
    • Unfurling Unlimited Possibilities in Zoho Cliq 🔗

      Are you tired of your app links looking plain? Imagine if the shared links came to life with custom previews, organized data, and one-click actions, making chats more interactive. With the Cliq platform's unfurl handlers, let's see how developers can
    • Recent Topics

    • VOIP integration

      I emailed this question to rishi but never got a response. I notice when I mouse over phone number it has a link to launch into SKYPE. We dont use SKYPE we use Xlite SIP client. Is it possible to change that link to launch our client API? If so how? If not any plans to make that VOIP integration customizable?
    • File Upload in Creator's Subfrom

      Hello Sir/Madam, Here is a Problem......... Scenario: In CRM One Custom Module (Payments) have one File Upload Field now we have to Upload that File into Creator's Custom Form (Documents) have one Subform (Documents) in Document Upload Field using Deluge
    • Food Delivery + ZohoCRM

      I've been using the free version of Zoho for a while, and I think it's time to upgrade. I'm sure I might be doing something wrong or I'm lacking some features I deliver frozen food, 2 days a week. For this I create a new task for the contact who orders me with - date he receives as Due Date - what I'm sending and at what time he can receive it in the Description Is there a better way of doing this?? I'd like to track what customers buys (the way I use it I have no record of that), and delete it from
    • Increase size of description editor when creating new ticket

      Please can you consider making the description editor in the create new ticket form a resizeable area as by default, it is very small and there appears to be no way to increase the size of it.
    • CRM For Everyone - Bring Back Settings Tile View

      I've been using CRM for Everyone since it was in early access and I just can't stand the single list settings menu down the left-hand side. It takes so much longer to find the setting I need. Please give users the option to make the old sytle tile view
    • Add "Ask Zia" Functionality for Report Creation in Zoho Desk

      Hi, How are you? We’ve noticed that Zoho CRM offers a very useful feature called "Ask Zia", which allows users to enter natural language prompts to generate reports quickly and easily using Zia's AI capabilities. Currently, Zoho Desk does not support
    • Compensation | Salary Packages - Hourly Wage Needed

      The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
    • Zoho FSM API to search Zoho FSM Assets by Asset_Number?

      How can I search or otherwise retrieve an Asset from the Assets module in Zoho FSM using the Asset_Number? The API docs seem to say that the only field that can be searched is the Asset Name. Is this true? https://www.zoho.com/fsm/developer/help/api/search-records.html
    • Proposal for Creating a Unique "Address" Entity in Zoho FSM

      The "Address" entity is one of the most critical components for a service-oriented company. While homeowners may change and servicing companies may vary, the address itself remains constant. This constancy is essential for subsequent services, as it provides
    • I can't use zoho in my personal computer

      Facing error on monitor Oops! An error occurred
    • My Zoho Account Not Working, Suddenly its stoped

      Hello Team, our company email account is not working, we are not receiving email. Website: www.urgentdubaivisaonline.com Email: social@urgentdubaivisaonline.com
    • MX verification

      Dear All I face a difficulties to verify MX records in my domain alfagrouptrading.sk it is since two days. records are correct and I am waiting for 48 hour I send email shown in the error message with no reply.in addition, it supposed to be propagated
    • I'm not receiving emails.

      Hello. I'm having an issue in which I am able to send emails using my zoho mail, but I seem to be unable to receive them. please help.
    • Change zoho email address

      I am displeased with the email address I created. It's too long.
    • Departments Limit

      There is a limit of departments that i can have on zoho desk?
    • CRM for Everyone - More Actions Option to Create Record

      Please consider the option create a new record for the relevant record from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need
    • 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
    • Mass Update of Lookup Fields not possible

      Hello List I've created a custom field for Leads and Contacts 'Current Campaign'. This is very Handy as I can filter leads and then related them to a campaign. Everything ready, but then I realized that mass update doesn't work for lookup fields... a
    • Time Limited Coupon or Expiring Link in Workflows

      I would like to see a feature where I can include a time limited link in Workflow Campaigns. For example: I could link to a sales page with a discount and set the link to expire after 24h. The link would be generated by Campaigns for each campaign sent
    • How to create a form using both contact and account fields?

      I am sending a prefilled form from CRM with fields mapped, to update records in CRM. If I link the CRM field to the Contacts module, the Account Name field doesn't come up as an option in CRM. If I added it under Related Fields, my understanding it would
    • Boost your Zoho Desk's performance by archiving tickets!

      The longer your help desk operations are, the more likely it is to accumulate tickets that are no longer relevant. For example, ticket records from a year ago are typically less relevant than currently open tickets. Such old tickets may eventually lead
    • Are Zoho Help Center Email Notifications Customisable?

      Hi, I would like to find out if the Zoho Help Center email notifications can be customised to add our own styling and branding? These are the notifications that get sent when a client adds a new topic, adds a comment, signs up to the help center, etc?
    • Wizard Form

      I would like the option to create a wizard that works when you create a record and contacts that are already in the CRM captured with a web 2 lead form (field data inserted in to the wizard).  Having the option to create up to 3/4 segments per screen
    • Two-Way Sync Zoho CRM Custom Module with Zoho FSM Company Addresses

      Business fact: Many companies don't just have one location. They have multiple locations (some have many), with addresses we need to know for service, deliveries, etc. We have created a custom "Sites" module in Zoho CRM to store an Account/Company's addresses
    • Sharing and Converting Custom Reports Across Departments in Zoho Desk

      Hello, We initially started using Zoho Desk with a single department (Department "A"), which included multiple teams. Nearly a year later, we identified several limitations that led us to create three additional departments ("B", "C", and "D") with replicated
    • Dynamic Dashboard for CRM Flyout/Widget

      Hello, Apologies if this has been answered before—it's possible I'm just not searching the community with the right terms. I'm trying to create a dashboard in Zoho Analytics that pulls together reports from several datasets (e.g., CRM Deals, Books Invoices,
    • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

      Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
    • Does Thrive work with Zoho Billing (Subscriptions)?

      I would like to use Thrive with Zoho Billing Subscriptions but don't see a way to do so. Can someone point me in the right direction? Thank you
    • Zoho Sprints mobile app(Android and iOS) v2.0

      Hello everyone! We’re thrilled to announce that Zoho Sprints Mobile app2.0 is now live. With the newest version of the Zoho Sprints mobile app, we hope to provide a fresh, faster, and intuitive experience for managing your sprints on the go! Whether you're
    • Subform dynamic fields on Edit, Load of Main form.

      Main Form: Time_Entry Sub Form (separate form): Time_Entries Time_Entries.Time_Entry_No is lookup to - Time_Entry.Time_Sheet_ID (auto number). I would like to disable some of the subform fields upon load (when edited) of the Time_Entry main form. What
    • View Answer Bot conversations?

      We are trialing Zia and are experimenting with Answer Bot on our knowledge base. So far so good! Management asks me if it is possible to view Answer Bot conversations, the purpose being to look over its shoulder and confirm that it is working as des
    • Delivery note from order or from offer

      Hello, in our company and in a lot of companies in Italy, the standard workflow is (in order): 1) Offer 2) Customer order 3) Delivery note. We can have also more delivery notes in one month. 4) Invoice at the end of the month from delivery note (so only
    • Sesiones 1:1 en Zoholics España 2025

      Una de las experiencias más valoradas por los asistentes a Zoholics son las sesiones 1:1 con nuestros expertos técnicos. Este 2025, las traemos de vuelta con aún más fuerza: cada entrada a Zoholics España 2025 incluye una sesión individual gratuita de
    • "The email sending domain must have an active and functional website so that we can proceed with the review."

      I've requested the approval of my account, and got the following response back: "The email sending domain must have an active and functional website so that we can proceed with the review." This is absolutely false. The website I have provided has been
    • Gestion de suivi des expéditions

      Le suivi des expéditions est un élément indispensable à une gestion réussie de la chaîne d'approvisionnement. Aussi bien le fournisseur que le client peuvent bénéficier de la transparence et de la responsabilité apportées par le système ; ce dernier fournit
    • Is there a way to set Document Owner/Sender via the API

      When sending requests for zoho sign, it would seem zoho uses the id of the person that created the zoho api cred to determine the owner_id, is there a way to set a default for this?
    • Last activity time is acting like last modified time

      When i edit the description or any field in the potential, account, contact and lead, the Last Activity Time is being updated like the Modified Time. This is messing all workflows and reports and we are unable to track real last time of activities like mentioned in this KB article http://crmkbase.zoho.com/what-is-the-difference-between-record-modified-time-and-record-last-activity-time
    • Integrate QuickBooks with Bigin and streamline your sales and accounting!

      If your business relies on Bigin for customer management and QuickBooks for accounting and invoicing, this new integration is here to make your operations more efficient. By connecting these two platforms, you can now manage your CRM and financial processes
    • Upload File via email

      Will there be an option to upload a file via email?
    • Footer: Zoho make a big downgrad with new footer option

      Every post about the new footer function is negative and all say: its a big downgrade. The idea behind this new function was: Make it more simple. Great, now its faster and more simple to add an footer. But nobody from zoho team think about the more bigger
    • Next Page