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 

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • 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
          • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

            Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
          • App Spotlight : PagerDuty for Zoho Cliq

            App Spotlight brings you hand-picked apps to enhance the power of your Zoho apps and tools. Visit the Zoho Marketplace to explore all of our apps, integrations, and extensions. In today's fast-paced world, seizing every moment is essential for operational
          • 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

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ








                                ご検討中の方

                                  • Recent Topics

                                  • Task and Milestones - Dependency feature needed

                                    I'm sure we're not the first to bring this up. We've been using zoho project for a while. Every project manager knows that to manage a successful project you need option to stack tasks and milestones and be able to create dependencies between tasks and milestones. I think you get the idea... Can you let us know if this feature is in the making or not? any chance we'll see this in future releases? If you need customer feedback about this feature or other enhancements, we'll be happy to test new products
                                  • How to update task start date when project start date changes?

                                    Hi there, When the start date of a project changes, it's important to update the start dates of the tasks associated with that project to reflect the new timeline. Is there a way to shift the start date of all project tasks when the start date of a project
                                  • ZOHO DESK | SET PERMISSION NOT TO ALLOW SPECIFIC AGENTS TO CREATE TICKET

                                    Hi Zoho Team, I have a question regarding this: "Team Desk are the ones to have the permission to create a ticket, Team OPS resolvers must not create a ticket." - How to set permission to Team OPS resolvers for not creating a ticket? Only Team Desk should
                                  • On success Workflow not triggering from external Zoho Form submission

                                    Hello everyone, I'd really appreciate your help. I'm building a system, where I'm using Zoho Creator as a crm/spreadsheet to manage movements of inventory. I have 3 "forms" or tables, where one is a main table for obersving status on all inventory, another
                                  • Add Comprehensive Accessibility Features to Zoho Desk Help Center for End Users

                                    Hello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request to enhance the client-facing Help Center in Zoho Desk with comprehensive accessibility features, similar to those already available on the agent interface. 🎯 Current
                                  • Tax is missing in expense unable to submit report

                                    Im getting the above error when submitting a report with an expense. Its complaining about the Tax is missing but there is no Tax area just "Amount". And if I try to Itemize the amount to break out the tax portions with the initial product portion it
                                  • Time-based Automations updates does not trigger Webhook

                                    Hi, When a ticket is updated by Time-based automation, it doesn't seem to trigger the webhook event. I looked at the ticket history for the problematic tickets, they were all changes made by action with this label: `Ticket was updated through a Time-based
                                  • Can't find parent child ticketing

                                    Hi I can't find parent child ticketing under tickets in this new organization... I have in the past on other organizations
                                  • Filtering Parent and Child Tickets in Analytics

                                    Hello Zoho Support Team, We’ve noticed that when checking our ticket analytics in Zoho Desk, the data merges both parent and child tickets for key metrics like the number of new tickets, closed tickets, and first response time. This results in inaccurate
                                  • Link Zoho Inventory Sales Order with Zoho Desk Ticket

                                    I'd like to, in a Zoho Inventory Sales Order, see linked/related Zoho Desk tickets. When I'm in Zoho Desk, I can look up related tickets to the sales order, but I can't seem to do it in the reverse manner (where when I'm in a Zoho Inventroy Sales Order,
                                  • Shopify integration

                                    I need to integrate Shopify with Zoho Books
                                  • Function #32: Schedule low stock notifications on a timely basis to specific users of the organization

                                    Hello everyone and welcome back to our series! For a business that heavily relies on inventory, monitoring the stock levels and getting timely notifications of low stock items will ensure a smooth sail. Zoho Books allows you to always keep a check on
                                  • Can't type latin characters Mac x Windows

                                    I access a Win XP machine using Chrome on Mac OS X High Sierra and I can't get special characters like á é ó â ê ô ã õ à í ú to work. I tried a few different keyboard layout setups, but nothing worked. I end up having to type a lot of stuff in a local notepad for further copy and paste, which is not convenient at all. Am I missing anything? How can I make this work? Thanks.
                                  • Zoho People & Zoho CRM Calendar

                                    Hi, Does anyone know if it is possible to link Zoho People and the calendar in CRM? I would like when holidays are approved they automatically appear in the calendar on CRM. Thanks 
                                  • How to add Leave Type Permission Start Time

                                    Hi, I have a requirement to add Leave Type : Permission Start Time on the email template to which is end to the reporting manager. But I am unable to find the field in the list of fields. How to achieve this?
                                  • How to get batch number of item by api?

                                    Hi there, Is there any way to get batch number of item by api? Batch number is the batch reference number in https://www.zoho.com/inventory/help/advanced-inventory-tracking/batch-tracking.html . When I call the https://www.zoho.com/books/api/v3/#Items_Get_an_item
                                  • Questions about ACH in Zoho Billing

                                    We have ACH enabled for subscriptions in Zoho Billing and we have the option enabled for users to be able to log in to their bank to add the account to their payment methods. Questions: 1) If the user's bank isn't supported via the log-in method, will
                                  • Zoho Writer Default Publish Setting for Mail Merge

                                    Hello, I was thinking of using Mail Merge to create documents from CRM and automatically link them. However, I noticed the "publish" function and it seems the default is "to the world". This creates some anxiety as it is not clear what this "to the world"
                                  • Contacts Profile

                                    Is there a way to add a picture to my contacts profile? You have an outline of a person but no way I can see to import a picture.
                                  • Tip 46: View resource allocation while adding or editing tasks

                                    Keeping track of employees workload can be daunting but also necessary. Overloading employees with work can cause burnout and reduce productivity.  Managers should be able to identify resources who are less engaged when assigning tasks. This will ensure a balanced workload and also improve employee's efficiency. Zoho Projects lets you identify resources who are available to take up a job when you add or edit a task.  ​ Assign the task to team members and the calendar in the Start Date field will display
                                  • Switching Between Multiple Zoho One Organizations in New UI

                                    Here’s a polished version in English that you can use on Zoho’s support or community forum: Subject: Switching Between Multiple Zoho One Organizations in New UI Hello Zoho Community / Support Team, I’m currently managing two independent Zoho One organizations.
                                  • .ds import error from .ds file

                                     Problem encountered while creating the application Exception occured while publishing message to the topic :: [DataModelTopic]
                                  • Fully functional FSM workflow

                                    I am using Books, FSM, Begin and Desk. At this moment, FSM is not fully functional even on its own. For example, Customer A buys 4 air-cons and 3 brackets from us. We are fine to create WO manually in FSM. This should be the full loop for a FSM workflow:-
                                  • Connect Woocommerce new order to zoho books via zoho flow

                                    Hello i want help to create a flow to create a new sales order from woocommerce to zoho books. Can someone send me step by step flow, functions and fields?
                                  • What's New in Zoho Invoice | April - June 2025

                                    Hello everyone! We're excited to share the latest feature updates and enhancements we've made to Zoho Invoice from April to June 2025. In this, you will learn more about the following features: New Integrations via Zoho Marketplace Add Images to Email
                                  • PROJECTS - More flexibility with task and pricing

                                    Hi Everyone, I would like to use PROJECTS in my Zoho Booking app but it does not fit into my business. For example: I charge per sessions fixed price. My session usually are 2 hours and I bill the customer on the end of the month. My session can have
                                  • Is it possible to change default payable account for a bill?

                                    We have a case where we need to change a bill account from the default accounts payable to another account (it can be current asset or current liability, depending on the case). However, Zoho Books has set default account for bills, (accounts payable)
                                  • how to upload a reviewed price list in zoho to replace the existing price list

                                    Price list upload for my zoho books
                                  • Company details and emails

                                    Our company has recently been rebranded and we have new email address - How do I update information for users. I have tried to re invite users with new email but it sends me to organization and there is no where I can change the email or invite with new
                                  • Linking Resale Certificates to Customer Locations

                                    Florida Resale Certificates must be on every customer invoice. We have customers with multiple locations and each location has a seperate FL Resale Certificate. The FL Resale Certificate makes the transaction EXEMPT from Sales Tax. Can FL Resale Certificate
                                  • Notebook App Not Opening

                                    I love this app but for the last 2 days it recuses to open. My phone tells me the app is bugged and I must wait for a new update. Is anyone else having this problem or is something going on with me? I have many important notes that I can't necessarily
                                  • Admin and Dispatcher Users show as Field Technicians in Dispatch Module?

                                    Hi Zoho, Our Admin and Dispatch user both show up as Fied Technicians / Field Agents in the Dispatch module, but they most certainly should not be assigned to any of the work orders and service appointments. These users are NOT service resources. How
                                  • Copy Sales Order Reference# to Purchase Order#

                                    Hello, We use our customer's purchase order number as the order number on our purchase order to the supplier.  We direct ship everything from our suppliers and the customers then see their PO number on the packing notes (instead of a sequentially-generated one). Therefore, is it possible to use automation to copy the Sales Order Reference# (customer PO) to the respective Purchase Order# (our PO) when converting the Sales Order to a Purchase Order?
                                  • Free webinar: Zoho Sign in Q2 2025: A quick walkthrough

                                    Hi there! We’re halfway through the year—and Zoho Sign has some exciting enhancements to show for it! Join us in our upcoming webinar to discover what's new and what you can look forward to. What will this session cover? Explore the newest features introduced
                                  • Using a Webhook as an Action

                                    I have been able to setup where I can use a webhook as a Trigger, but I am wondering how I can use a webhook as an Action. In the Zoho Flow Builder when using Zoho CRM as a trigger, I do not see a way to invoke a URL to POST json data that can be used
                                  • Adding commas to a numeric value

                                    Hi, I want to add commas to numeric values so that they look like money E.g 1234.56 to 1,234.56 12345.67 to 12,345.67 12345678.90 to 12,345,678.90 How do you do that in Deluge? Thanks for the help
                                  • Pushing Zoho People leave into Microsoft calendar: how to chose how "event" is shown (busy, free etc)

                                    Hi, how can I select how a "leave" event is pushed into Microsoft calendar? I want for leave "working elsewhere" to show as working elsewhere and NOT as busy.
                                  • Custom Bulk Select Button

                                    Zoho CRM offers the ability to select multiple records and invoke a Custom Button This functionality is missing from Recruit Currently we can only add buttons in the detail page and list But we cannot select Multiple Records and invoke a function with
                                  • Tiktok and Instagram Carousel with Music

                                    Is it possible to add music or sound (can be downloaded or uploaded or attached) when we upload carousels in IG and Tiktok?
                                  • [Product Update] Locations module migration in Zoho Books integration with Zoho Analytics

                                    Dear Customers, As Zoho Books are starting to support an advance version of the Branches/Warehouses module called the Locations module, users who choose to migrate to the Locations module in Zoho Books will also be migrated in Zoho Analytics-Zoho Books
                                  • Next Page