Configure ChatGPT in Zoho Cliq (Now with GPT-4 ⚡)

Configure ChatGPT in Zoho Cliq (Now with GPT-4 ⚡)

Updated for GPT-4 Support: The post and scripts has been revised to take advantage of the new GPT-4 model's capabilities. Please use the updated version for enhanced performance and accuracy.  

If you have been on the internet for the past few months, you have probably heard of ChatGPT. It has been making waves across the world as the next big technological revolution in artificial intelligence. ChatGPT is an advanced language model developed by OpenAI. It uses deep learning techniques and is trained on a massive amount of data to generate human-like responses to text inputs. With its ability to understand context, recognize patterns and relationships, and generate natural language, ChatGPT is capable of providing informative and engaging answers to a wide range of questions on diverse topics.

According to a recent PWC report, 67% of business executives think integrating AI into their business will greatly improve performance and efficiency. You can also integrate ChatGPT into Cliq by following these easy steps:
  • Create a bot with channel participation permission (make sure to check the options for the bot to "send messages" and "listen to messages" in the sub actions)
  • Go to Profile → Bots & tools → Bots → Create Bot → Enter the name, description and enable channel participation → Save.
A helpful rule of thumb is that one token generally corresponds to ~4 characters of text for common English text. This translates to roughly ¾ of a word (so 100 tokens ~= 75 words).

Message Handler:

If you want to ask questions to the bot in a one-on-one chat directly, you will have to modify the message handler. To do that, follow these steps:
  • Navigate to the message handler and click on Edit Code. Now copy the below code and paste it:
  1. info message;
  2. response = Map();
  3. // Need to add openAI token
  4. token = "Bearer sk-GlHHcXXXXXXXXXXXXXXXXXXXXXXXXX";
  5. header = Map();
  6. header.put("Authorization",token);
  7. header.put("Content-Type","application/json");
  8. contentList = list();
  9. contentList.add({"role":"user","content":message});
  10. params = {"model":"gpt-4","messages":contentList,"temperature":0.9,"max_tokens":2048,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"stop":{"Human:","AI:"}};
  11. // Making post request 
  12. fetchCompletions = invokeurl
  13. [
  14. url :"https://api.openai.com/v1/chat/completions"
  15. type :POST
  16. parameters:params + ""
  17. headers:header
  18. detailed:true
  19. ];
  20. info fetchCompletions;
  21. if(fetchCompletions.get("responseCode") == 200)
  22. {
  23. // Populating the response to human readable format
  24. answer = fetchCompletions.get("responseText").get("choices").toMap().get("message").get("content");
  25. info "answer" + answer;
  26. response.put("text",answer);
  27. }
  28. else if(fetchCompletions.get("responseCode") == 401)
  29. {
  30. response = {"text":fetchCompletions.get("responseText").get("error").get("message")};
  31. }
  32. else if(fetchCompletions.get("responseCode") == 429)
  33. {
  34. response = {"text":fetchCompletions.get("responseText").get("error").get("message")};
  35. }
  36. else if(fetchCompletions.get("responseCode") == 503)
  37. {
  38. response = {"text":"Service Temporarily Unavailable"};
  39. }
  40. else
  41. {
  42. response = {"text":"I dont have any knowledge in this. Please ask me something else"};
  43. }
  44. return response;
  • Then navigate to this link
     and generate a token in openAI and then replace the token in line 4 (It should look something like this : "Bearer sk-K4ilep5NLxxxxxxxxxxxxxxxxxxxxxxxxxxx").
    Note: Project-based API keys from OpenAI will not work for this integration. You need to use a secret API key associated with your personal or organizational OpenAI account. 
  • Save the message handler. Now the bot is ready to answer your questions.

Participation Handler:

If you want to add the bot to a channel so it can answer questions from any participants, you will have to modify the participation handler. To do that, follow these steps:
  • Add the bot to the required channel.
  • Navigate to the bot participation handler and click on Edit Code. Now copy the below code and paste it.
  1. response = Map();
  2. if(operation == "message_sent")
  3. {
  4. info data;
  5. if(data.get("message").get("type") == "text")
  6. {
  7. response = Map();
  8. // Need to add openAI token
  9. token = "Bearer sk-GlHHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  10. header = Map();
  11. header.put("Authorization",token);
  12. header.put("Content-Type","application/json");
  13. contentList = list();
  14. contentList.add({"role":"user","content":data.get("message").get("text")});
  15. params = {"model":"gpt-4","messages":contentList,"temperature":0.9,"max_tokens":2048,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"stop":{"Human:","AI:"}};
  16. // Making post request 
  17. fetchCompletions = invokeurl
  18. [
  19. url :"https://api.openai.com/v1/chat/completions"
  20. type :POST
  21. parameters:params + ""
  22. headers:header
  23. detailed:true
  24. ];
  25. info fetchCompletions;
  26. if(fetchCompletions.get("responseCode") == 200)
  27. {
  28. // Populating the response to human readable format
  29. answer = fetchCompletions.get("responseText").get("choices").toMap().get("message").get("content");
  30. response.put("text",answer);
  31. }
  32. else if(fetchCompletions.get("responseCode") == 401)
  33. {
  34. response = {"text":fetchCompletions.get("responseText").get("error").get("message")};
  35. }
  36. else if(fetchCompletions.get("responseCode") == 429)
  37. {
  38. response = {"text":fetchCompletions.get("responseText").get("error").get("message")};
  39. }
  40. else if(fetchCompletions.get("responseCode") == 503)
  41. {
  42. response = {"text":"Service Temporarily Unavailable"};
  43. }
  44. else
  45. {
  46. response = {"text":"I dont have any knowledge in this. Please ask me something else"};
  47. }
  48. return response;
  49. }
  50. }
  51. return Map();
  • Make sure to replace the token in line 10 with your Open AI token. 
  • Save the bot participation handler. That's it. You can now ask questions directly to the ChatGPT Bot in the configured channel without leaving Cliq.
Note: It should be noted that, if you want to use the bot at the organization/team level, it's better to use connections so each user can use their own openAI account instead of all the queries going through a single openAI account token. This approach can be beneficial as it can prevent one user's actions from negatively impacting the entire team's access to the API.



    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                                        • Sticky Posts

                                                        • New in Zoho Chat: Threaded conversation at its finest best

                                                          Perform effective team communication in Zoho Chat with our new 'Reply' option.   Converse and stay focussed on the parent conversation, rather than getting entangled in the web of several, never-ending sub threads.   To reply to a certain message, all you need to do is hover to the left hand side of the message. Then, click on the three dots to open a pop up menu. Here, click on the Reply button and type the reply to the message in the compose box and press Enter.   Voila, that was pretty simple. 
                                                        • Changes in Cliq iOS app notification due to iOS 13 and Xcode 11

                                                          Hello everyone! With the iOS 13 update, Apple has updated its policy on usage of VoIP push notifications. Over the past few months, we tried our best to provide a similar experience with the updated policy.  Changes in iOS 13:  With iOS 13, Apple mandates all VoIP push notifications to be reported to the CallKit framework as a new call. If a VoIP push notification is not reported to the CallKit within a designated time window, iOS will terminate the app. If enough VoIP push notifications are not
                                                        • What's new in Zoho Cliq - June 2020 updates

                                                          Hello again, everyone! I'm back to share with you the recent feature improvements and updates that we've pulled together for enhancing your experience in Cliq. Here's what's new this June for you all in Cliq's web and iOS app! New on Cliq Web: Drag and drop files to a chat in your left side panel   Now you can drag and drop attachments from your open conversation window to a specific chat or channel in the left side menu without opening it. Swift up actions and collaborate efficiently with Cliq's
                                                        • 4 Things You Should Do Once You Get Started with Cliq

                                                          Hey there, new user!  You've successfully logged in and set up your organization and you're all set to start working. What's next? Buckle up because here are 4 essential things you need to do first in order to get the most out of your Cliq experience:   1. Invite your colleagues   Now that you've set up your Cliq for business, you need to bring in all your employees, of course, because how else can you collaborate with them?   To invite your colleagues to Cliq, head on over to the Admin Panel which
                                                        • New in Zoho Chat : Search for contacts, files, links & conversations with the all new powerful 'Smart Search' bar.

                                                          With the newly revamped 'Smart Search' bar in Zoho Chat, we have made your search for contacts, chats, files and links super quick and easy using Search Quantifiers.   Search for a contact or specific conversations using quantifiers, such as, from: @user_name - to find chats or channel conversations received from a specific user. to: @user_name - to find chats or channel conversations sent to a specific user. in: #channel_name - to find a particular instance in a channel. in: #chat_name - to find


                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator 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

                                                                                                        • Is Zoho tables still being developed?

                                                                                                          Has this product been abandoned? I haven't seen any useful new features or stability improvements over the past six months or more. I think Tables is a great concept, filling a niche between spreadsheets and full database tools, but the current implementation
                                                                                                        • Zoho CRM sync

                                                                                                          Just wondering if the plan is for the Zoho CRM implementation to always be just an import and not a sync? At the very least, a one-way sync that kept the data in Tables up-to-date would increase the amount of usecases, but ideally the option to two-way
                                                                                                        • How to create a directory report from one-to-many relationship

                                                                                                          Hi all, Newbie here. I'm converting an Access DB to Creator. I've learned Forms are tables and Reports are used to edit table rows, not Forms. I've got the data loaded and can maintain it with the Reports already done. I've done filtering and sorting,
                                                                                                        • How to Delete Old Tasks/Streams Assigned by Deactivated Users? 'Operation Not Permitted' Error

                                                                                                          Hello, I’m using Zoho Mail and have several old tasks assigned to me in Tasks and Streams. These tasks were created by former employees whose accounts are now deactivated. When I try to delete these tasks, I get an "Operation Not Permitted" error. These
                                                                                                        • Profile date settings

                                                                                                          At present I have "EEE, MMMM dd, yyyy" but this takes an exessive amount of column space, we should be able to input our own format. I would like to use "EEE, MMM dd, yy" - a much shorter version of the above but with the same abbreviated info, requiring
                                                                                                        • Wich version of Backstage is included in Zoho One

                                                                                                          Hello I am in the event business and i am considering Zoho One to replace my current tools. I will need Backstage to manage my events but I am wondering wich version of backstage will I get if I subscribe to Zoho One. Thank you Guillaume
                                                                                                        • How to restore deleted campaigns?

                                                                                                          I accidentally deleted my first campaign that went out today (08/21/18). How do I restore it?
                                                                                                        • Organize and Clone Task Custom Views

                                                                                                          We have rolled out two new enhancements to task custom views: Custom View Groups and Custom View Clone. Custom View Groups Similar to predefined view groups, we have introduced groups for custom views to help organize and categorize them. My Custom Views:
                                                                                                        • Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups

                                                                                                          Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
                                                                                                        • Stock Count History in Product Details – Zoho Inventory

                                                                                                          Hello Zoho Team, When I perform a Stock Count for a product in Zoho Inventory, I would like to view the history of those stock counts later — especially from the product details page. Currently, I can perform the count and update the quantity, but I’m
                                                                                                        • Kits: Option to Hide Associate Items on Documents

                                                                                                          The new Kit type of Composite Item is very helpful, and we're already using it in several different ways. One problem is that there seems to be no way to hide the components on some documents, including Package Slips. There is an option given in settings
                                                                                                        • Pick List Issues

                                                                                                          I have created a pick list that looks at a table in a sheet, it selects the column I want fine. Various issues have come along. The option to sort the pick list is simplistic, only allows an ascending alphabetical sort. Bad luck if you want it descending.
                                                                                                        • Zoho Books CREDIT LIMIT is completely USELESS due to a BUG!!! Please fix it ASAP!!

                                                                                                          Credit Limit should not be taken into account if payment terms on the Invoice are without credit. If selected Credit 0 days (Prepayment) why in this world would a notification pop up saying credit limit is exceeded and not allowing to create an invoice?
                                                                                                        • Show item Cost value on Item screen

                                                                                                          The Item screen shows Accounting Stock and Physical Stock. It would be very helpful if value information could be displayed here as well, for instance Cost Price. Currently, to find the Cost Price (as used for inventory valuations) from inside the item
                                                                                                        • Show all items making up the composite item in transactions

                                                                                                          Dear Zoho, Currently, when we select a composite item in Zoho Inventory for a transaction, we do not receive a breakdown of the individual items that make up the composite. This makes it challenging for our team to accurately pick, pack, and ship the
                                                                                                        • Is it possible to adjust the web browser tab title (when a ZoHo Desk ticket is opened)

                                                                                                          Hi All, When I open a ZoHo Desk ticket in a web browser, the tab title (text that appears at the top of the browser tab) uses the logic: *company icon picture* (xxxx) #ticket number - company name See below (highlighted in red) for reference. Company
                                                                                                        • Configure ChatGPT in Zoho Cliq | Now with GPT-4!

                                                                                                          Updated for GPT-4 Support: The post and scripts has been revised to take advantage of the new GPT-4 model's capabilities. Please use the updated version for enhanced performance and accuracy. If you have been on the internet for the past few months, you
                                                                                                        • Editing the text on the Help Center home page

                                                                                                          Is it possible to edit the "Welcome to Help Center" message anywhere? This one: We'd like to be able to tailor it a little more ourselves.
                                                                                                        • Upcoming Changes to LinkedIn Parsing in Resume Extractor

                                                                                                          Starting 31 July 2025, the Zoho Recruit Resume Extractor will no longer support direct parsing of candidate data from LinkedIn profiles. Why Is This Change Needed? In accordance with LinkedIn’s platform policies, extracting profile data through browser
                                                                                                        • How to Initiate WhatsApp Message on SalesIQ?

                                                                                                          I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                                                                                        • Have completed Zoho Sign documents attach automatically to contact and/or account

                                                                                                          Hello, Just used ZohoSign for the first time to get an e-signature on an important document. Setting up the template was nice and easy and configuring the request to go to the right people and training a member of staff was also very easy. HOWEVER Why
                                                                                                        • Rich Text For Notes in Zoho CRM

                                                                                                          Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                                                                                        • "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."

                                                                                                          @Dr Saurabh Joshi @Haiku Technical Support @Ishwarya SG @Sparrow Hill President @Hugh Marshall "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."
                                                                                                        • Using email "importance" as workflow-criteria

                                                                                                          I'd like to set up a workflow that triggers if an incoming email has been flagged as "high importance" but I'm not seeing any way to do that. Hopefully I'm just missing something obvious...?
                                                                                                        • Send emails directly via Cases module

                                                                                                          Greetings all, The ability to send emails from the Cases module, which users have been eagerly anticipating, is now available, just like in the other modules. In Zoho CRM, Cases is a module specifically designed for managing support tickets. If your organization
                                                                                                        • Currency transition

                                                                                                          We are using Zoho CRM in Curacao, Dutch Caribbean. Our currency is currently the ANG. Curacao will be transition ing from using the ANG (Antillean Guilder) to using the XCG currency (Caribbean Guilder) on March 31st 2025, see: https://www.mcb-bank.com/caribbean-guilder.
                                                                                                        • Color of Text Box Changes

                                                                                                          Sometimes I find the color of text boxes changed to a different color. This seems to happen when I reopen the same slide deck later. In the image that I am attaching, you see that the colors of the whole "virus," the "irology" part of "virology," and
                                                                                                        • Update Lead Status in Zoho CRM When a Meeting is Booked via Microsoft Bookings

                                                                                                          Hi everyone, I’m trying to streamline our lead management process and would like to automatically update the Lead Status in Zoho CRM whenever a meeting is booked through Microsoft Bookings. Has anyone successfully implemented this kind of integration
                                                                                                        • How to link web sales payments through Stripe to invoices?

                                                                                                          I have just set up an online shop website which accepts payments through Stripe.  The payment appears in Zoho Books through the Stripe feed as 'Sales without invoices'.  In order to keep Zoho Inventory in step, I manually (for now) create a Sales Invoice
                                                                                                        • Zoho Website Site Speed Up & Setting

                                                                                                          We are experiencing slow loading speeds on our Zoho website and would like assistance in optimizing its performance. Kindly review the site and suggest or implement necessary improvements to enhance speed, especially related to: > Caching mechanisms >
                                                                                                        • Kaizen #199: FAQs on Multi-Select Lookup (MxN) Field in Zoho CRM

                                                                                                          Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone. Got
                                                                                                        • NFC Support

                                                                                                          Hi, I would like NFC Support like Zoho Creator, to pre-fill field values by scanning an RFID device. Zoho Creator NFC here: https://www.youtube.com/watch?v=F4JoMWnF82I Both on a Field's User Input (Mobile Apps), in additon to QR Code & Barcode today,
                                                                                                        • Zoho Desk Android app update: Enhanced UI of the History tab.

                                                                                                          Hello everyone! In the latest Android version(v2.9.10) of the Zoho Desk mobile app, we enhanced the UI of the 'History' tab within a ticket. Also, we have introduced a filter option to easily search the history based on the actions performed on the ticket.
                                                                                                        • UK Registration for VAT with existing stock/inventory

                                                                                                          We have an existing inventory of stock and are investigating how to handle the conversion from a UK VAT unregistered company to a UK VAT registered company. Enabling VAT registered status looks extremely easy, but we cannot find any way within Books to
                                                                                                        • Blueprint - Mandatory file upload field

                                                                                                          Hi, File upload (as we as image upload) field cannot be set as mandatory during a blueprint transition. Is there a workaround? Setting attachments as mandatory doesn't solve this need as we have no control over which attachments are added, nor can we
                                                                                                        • Is Zoho Marketing Plus part of Zoho One?

                                                                                                          Hi, Is the new fancy Zoho Marketing Plus part of the Zoho One package? Is there any benefit in using this rather than the standalone products? Many thanks Jon
                                                                                                        • Is it possible to Bulk Update 'Product Name' in Zoho Desk?

                                                                                                          Is it possible to Bulk Update 'Product Name' in Zoho Desk? I cannot see that option now. Kindly help how we can do it.
                                                                                                        • Trigger action after workflow

                                                                                                          I would like to trigger a deluge function after the approval workflow is complete. Is this possible? The objective is to take the approved document and move it over to Zoho Contracts to send out to our customer for review and signature. The reason we
                                                                                                        • Change visable Subform fields

                                                                                                          I have a form with 4 subforms in it. I added another field to each of the subforms in my main form. Now, how do I update the subforms to show the new fields that I added?
                                                                                                        • Announcing Agentic AI - Ask Zia!

                                                                                                          We are delighted to roll out the new agentic AI capabilities in Ask Zia, where every stage of the BI workflow is assisted by AI. With a human-in-the-loop approach, Ask Zia ensures that you’re in command of the decision, while AI handles the complexity.
                                                                                                        • Next Page