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 

    Access your files securely from anywhere

          Zoho Developer Community




                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day



                                        Zoho Marketing Automation
                                                • 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
                                                • 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
                                                • 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
                                                • Cliq Bots - How to make a bot respond to your messages?

                                                  Bots are just like your buddies with whom you can interact. They carry out your tasks, keep you notified about your to-dos and come in handy when you need constant updates from a third party application.  So, how can you make your bot respond to a message? The bot message handler is a piece of code triggered when a message is sent to the bot. Message handlers help you customise your bot responses to make it look conversational. The message input from the user can be either a string or an option selected
                                                • Cliq Bots - Get notifications about any action on an application with the incoming webhook handler!

                                                  Webhooks can be used to get notified about events happening in other applications inside Cliq. All bots in Cliq have their own incoming webhook endpoint. This makes it simple to post messages to the bot from external applications. Unlike the send message


                                                Manage your brands on social media



                                                      Zoho TeamInbox Resources

                                                        Zoho DataPrep Resources



                                                          Zoho CRM Plus Resources

                                                            Zoho Books Resources


                                                              Zoho Subscriptions Resources

                                                                Zoho Projects Resources


                                                                  Zoho Sprints Resources


                                                                    Qntrl Resources


                                                                      Zoho Creator Resources



                                                                          Zoho Campaigns Resources


                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

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

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Trigger Zoho Cliq Channel Workflows for API Messages

                                                                                                    Dear Zoho Cliq Team, I hope this message finds you well. We have noticed that reminders or messages posted to Zoho Cliq channels via the API do not trigger channel-based workflows. This limitation means that any bot configured with a participation handler
                                                                                                  • Webhook Trigger for New Messages in Cliq Channels

                                                                                                    Hello, I would like to request a feature to enable webhook triggers when a new message is added to a Cliq channel. This functionality would allow us to seamlessly send important information from Cliq to other relevant systems. This webhook trigger can
                                                                                                  • Ability to Edit the "Current Job Title" dropdown field

                                                                                                    Current experience/Issue: When a user (candidate) uploads resume to Zoho Recruit candidate portal, some fields are prefilled with the info from the resume/cv correctly. However, we've observed that; 1. the "Current Job Title" dropdown field is usually
                                                                                                  • I'm getting an "Invalid_scope" error, even though I used an access token generated with the correct scope.

                                                                                                    I'm getting an "Invalid_scope" error, even though I used an access token generated with the correct scope. Here’s what I did in Postman: Generated the code to create an access token using the following URL: https://accounts.zoho.eu/oauth/v2/auth?scope=ZohoCampaigns.contact.UPDATE&client_id=<client_id>&response_type=code&access_type=offline&redirect_uri=https://1882-2-26-193-161.ngrok-free.app
                                                                                                  • Problem viewing document imported from google drive.

                                                                                                    Hello, When I add a document via my google drive, it is impossible to preview it. I get the error “Files without extensions cannot be previewed. Download to view this file”. Could you please help me? Also, and this is more of a question: is there a way
                                                                                                  • Adding Bluesky channel

                                                                                                    Hello, Is Bluesky (AT protocol) soon added on Social ? Bluesky is being developped and is now open to anyone (no more invitation) Thank you
                                                                                                  • Problem configuring/customizing sales pipeline steps

                                                                                                    Hello, I have created several sales pipelines with different stages in them. Unfortunately I forgot to properly configure these steps (conversion probability, forecast category). How can I modify and customize all these steps? Thnak you by advance M
                                                                                                  • Custom Profile Agents Unable to Update Mandatory Phone Number in tickets under Zoho Desk

                                                                                                    Hi, While working in the Ticket module in Zoho Desk, agents with a custom profile are unable to update the Phone Number field (which is mandatory) under Account Information. The agents need to enter values such as "NA" or "Nil" in the field to close the
                                                                                                  • How Can i put a form in Zobot

                                                                                                    Hi,how can i integrate a form which has a multiple options to choose from.the form should be opened or displayed by zobot after it meets a requirement in the conversation. Thanks in advance !
                                                                                                  • 1 API to all channel

                                                                                                    hi zoho team: I am the product manager of anywheel, we are planning to integrate zoho, we want to integrate multiple channels through 1 API, please can you send me the integration document and guideline?
                                                                                                  • workflow for bounced email gets triggered, but email is status = opened

                                                                                                    Hello, I have a workflow that sends me an email if outgoing email are bounced. Now I got some kind of this emails, but the corrosponding contacts have status = open at the email. Why this bounce-workflow is triggered? Reports > Email Reports > Bounce
                                                                                                  • Response Violation - Zoho Desk

                                                                                                    Hi Team, I just need an information regarding the zoho desk - Response Violation and how can we avoid the tickets from getting the tickets response violated.
                                                                                                  • Power of Automation :: Automatically start / pause / stop timer on task status update.

                                                                                                    Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
                                                                                                  • Website Access Blocked (from one pc only) when attempting unattended access to any device

                                                                                                    Hello From one of my laptops I cannot access any remote device using unattended access. A Zoho Assist error page didplays 'Website Access Blocked. See attached.
                                                                                                  • Zoho Analytics to Zoho Sheets - automatic update?

                                                                                                    Hi all, If I create a zoho sheet from an Analytics Report or Analytics Data, is there a way for the zoho sheet to automatically update as the Report / Data in analytics updates?
                                                                                                  • Update Zoho Flow on Sprint Work Item Status Change

                                                                                                    Hello, I've contacted Zoho One support but have been unable to help in a timely manner, so I'm asking the community. I want to start using sprints, but I'm having an issue. I need to post updates to Slack when a Work Item has a status change. My understanding
                                                                                                  • Fixed Assets Register

                                                                                                    Thank you Zoho Books for adding fixed assets register. BUT there are certian tweeks that needs to be implemented. I found the following issues and seek improvements. 1) Fixed Asset Register Report in the Report Section has columns which are so much confusing.
                                                                                                  • Link to Desk tickets

                                                                                                    Hello, We are using Analytics to analyze data in Desk. Is there a way to embed a link to a ticket in reports? We'd love to be able to see the drill down data, and click a value in a result row that would launch the Desk Ticket in another window/tab. Thanks
                                                                                                  • Announcing new features in Trident for macOS (v.1.11.0)

                                                                                                    Hello everyone! Trident for macOS (v.1.11.0) is here with interesting features and enhancements to elevate your workplace communication and productivity. Let's take a quick look at them. Export emails. You can now export emails in the .eml file format
                                                                                                  • Simplify your day-to-day sales operations with new List View actions

                                                                                                    Greetings everyone, Here are a few enhancements for quick actions in modular List Views that will make your day-to-day CRM operations much easier. List Views in modules display records in rows and columns based on set criteria, and are useful for presenting
                                                                                                  • Zoho Sign Product updates - H2 2024

                                                                                                    Hello! We have almost come to the end of 2024! Here's a list of features and enhancements that went live in the later half of the year. NOM 151 certification Witness signing Formula, conditional, and custom fields Zoho Sign's extension for Bigin by Zoho
                                                                                                  • Constant Sync Errors 🙄

                                                                                                    I'm constantly getting sync error notifications with no actual resolution. Also... I have folders and files with a (!) on the cloud icon, indicating it's not accessible. This has also led to the complete loss of certain folders. Like... the go missing!
                                                                                                  • Build custom AI solutions with Catalyst’s QuickML capabilities in CRM

                                                                                                    Hello everyone, We’re thrilled to announce an improvement for our Zoho CRM Enterprise users: the ability to create custom AI solutions using Catalyst’s QuickML directly from Zoho CRM. As you may already know, Zia, Zoho CRM’s AI-powered assistant, offers
                                                                                                  • 【Zoho CRM】Webフォームに関するアップデート

                                                                                                    ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 「Zoho CRM アップデート情報」の中からフィルター機能に関するアップデートについて紹介します。 今回、「Webフォーム」機能に以下2点のアップデートがありました。 ダブルオプトイン(2段階の同意確認)後の確認メッセージのカスタマイズ 登録から確認まで一貫したユーザーエクスペリエンスを顧客に提供するために、カスタマイズされた確認メッセージを作成できるようになりました。 ダブルオプトイン認証メールのカスタマイズ 顧客に最初から興味を持ってもらえるよう、パーソナライズされたメールを作成できるようになりました。ユーザーのブランドに合った本文を作成し、パーソナライズすることで、様々な顧客に対応することができます。
                                                                                                  • Converting Time and Time Zones

                                                                                                    Hi Everyone I am trying to convert a time Zone to the local time of the user. I am fetching some data from an API, and it is coming back in this format: 2024-12-09T16:49:23Z This is in UTC/GMTZulu time. I am looking to convert it to the user time. In
                                                                                                  • Tip of the week 34 - 5 ways to maintain your email list

                                                                                                    A proper email list often reflects the reach of an institution. This reach is coveted by all but achieved by some. We often forget about drawbacks and incline towards numbers. Success is often reflected by quality and not quantity. This simple message reverberates in maintaining a hygienic email list. Here are five tips which will help you maintain a proper email list.    Organic email lists   Non-stop competition can make us susceptible to shortcuts like buying and renting lists from third party
                                                                                                  • Whatsapp Limitation Questions

                                                                                                    Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
                                                                                                  • Can not send campaign

                                                                                                    Hi, I'm trying to send a newsletter to my subscribers, but seems is not working - or maybe I did some wrong steps re. upgrades. I'm the admin for this account, no other person is using Zoho for my campaigns and I did not access the platform during last
                                                                                                  • Does Zoho campaign de-duplicate based on mobile for SMS campaigns?

                                                                                                    Hi - We recently sent our first SMS campaign using Zoho Campaign integrated into Burst SMS and got feedback that some of our customers received multiple messages. Upon inspection, this was due to multiple contacts in our list containing the same mobile
                                                                                                  • Multilingual Newsletter

                                                                                                    Hi, Can Zoho campaign give the possibility to create and send a campaign in English and French, giving the possibility to the person receiving it to switch from default language chosen for a campaign? thnaks
                                                                                                  • Top Menu Disappeared from Blog Page

                                                                                                    Hi, Our top menu disappeared at Blog Posts page. However, it's still visible any other page on the website. I attached two screenshots, so it can be understood clearly. How can we bring back top menu? Thanks, K.
                                                                                                  • Add Comment/Notes to Each Action in Zoho Flow for Internal Documentation

                                                                                                    It would be great if Zoho Flow could introduce a field to every action where we can make an internal note about why we are doing something with a specific action. This is especially helpful if more than one person from the organization handles automation
                                                                                                  • Questions about To Do

                                                                                                    1. I created a To Do note on Android and there is a line sorting option in the options drop down menu. But I didn’t find such an option in the PC client. I really need this option. 2. Why is there no search in To Do on the PC client? 3. Why is there no
                                                                                                  • Tip of the week 03 - Sending emails in batches

                                                                                                    Today's marketers not only want their email marketing to be efficient, but also smart. For an email campaign, you may think you have all the essential elements for lead conversion—a big mailing list, an attractive template design, and the most-engaging message content, but after hitting the ‘send’ button, you may not get the expected conversions. Wondering why? Here’s one of the major reasons. Many marketers miss out on sending the email campaign the right way. Did you know that you should not be
                                                                                                  • Sites Speed and Performance Grades

                                                                                                    I noticed that there are no recent inquiries or complaints about load speed or performance issues with Zoho Sites websites. However, I wanted to understand what Zoho has done to ensure that speed remains optimized, images are compressed and lazy loaded,
                                                                                                  • Feature Request - Configurable Payment Icons + Pay Now link in email.

                                                                                                    The PAY NOW buttons (icons) on invoices are really small. It would be great if we could make that a big, colored icon. Better would be to add a button to emails as well. 
                                                                                                  • Survey end date extension

                                                                                                    Hi, Is there any way to extend the end date of my survey? I needed more time in finding respondents that is why I need to extend the end date of my survey. Help. Thanks
                                                                                                  • AI read notes or explanation

                                                                                                    It would be such a great feature to have AI voices be able to read our Notes or Explanation If not having the AI speak the notes at run time, how about a feature where inside of Zoho Show you can have it look at all the notes of all the slides and have
                                                                                                  • Help with technical problem

                                                                                                    Hello, I want to make it so I can say how many days are left until a date is reached, and for it to give me a status on if its VALID, EXPIRED, or ABOUT TO EXPIRE, but the problem I'm having is I want it to be compared to the date every day, not just the
                                                                                                  • Managing Prepaid Hours for Consulting

                                                                                                    We are a consulting firm that bills clients a flat upfront annual fee plus an hourly rate and offer a discount for pre-paying a block of hours. Hours that surpass the pre-paid block are billed monthly at the normal rate. If there are any pre-paid hours remaining at the end of the project they are banked for future use. I'm not seeing a method of doing this in Projects/Books/CRM... thoughts?
                                                                                                  • Next Page