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




                                      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

                                                  • 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 DataPrep 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

                                                                                                  • Colour Coded Flags in Tasks Module List View

                                                                                                    I really like the colour coded flags indicating the status of the tasks assigned to a Contact/Deal in the module list view. It would be a great addition to have this feature available in the list view of activities/tasks. I understand you have the Due
                                                                                                  • Implement Meeting Polls in Zoho Bookings

                                                                                                    Dear Zoho Bookings Support Team, We'd like to propose a feature enhancement related to appointment scheduling within Zoho Bookings. Current Functionality: Zoho Bookings excels at streamlining individual appointment scheduling. Users can set availability
                                                                                                  • Two way sync between Bookings and Zoho Mail Calendar

                                                                                                    Is there a way to enable a two-way sync between Bookings and the Zoho Mail Calendar? As far as I know, it is only possible to check conflicts from Bookings and push meetings from Bookings to the Calendar. However, when I press the sync button, appointments
                                                                                                  • How to link Custom Fields in Ticket view

                                                                                                    Hi team, I have created 2 custom fields in our Accounts Module would like them to show in our ticket information. We don't have Enterprise so I cannot do it via a workflow, but I know you can do lookup fields to link modules. How would I go about making
                                                                                                  • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

                                                                                                    Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
                                                                                                  • A consultant with different working hours for each workspace

                                                                                                    As of now, it doesn't seem to be possible to set different working hours for a single consultant in two (or more) different workspaces. For example: A  consultant is going to work 2 weeks/month at workspace A and 2 weeks/month at workspace B. Yet, right
                                                                                                  • Zoho Finance Limitations 2.0 #12: Can't sync Books System Fields (Item Category or Preferred Vendor) to CRM Products. Double entry required

                                                                                                    We add products to Books and sync them to CRM whenever updates are done. However I still have to do double entry because the Books "Item Category" and "Preferred Vendor" fields are not available as options to sync. Scenario Workflow I add a new product
                                                                                                  • Rollup summary for custom module

                                                                                                    Rollup summary feature was introduced almost a year ago: https://help.zoho.com/portal/en/community/topic/introducing-rollup-summary-in-zoho-crm-public-early-access-2023 It does not support custom modules tough and this post aims to track such feature
                                                                                                  • Is it possible to set a value to a field based on certain conditions

                                                                                                    Greetings Say i have a field that i want to set its value based on the value of another field.. for example if "number" field has value greater than 10, i want to set my field's value to X. Or if radio group had option 1 selected, then i want to set my
                                                                                                  • What is the Desk API?

                                                                                                    I'm trying to fetch a lookup field data from desk to our creator application and it doesn't work. I'm guessing that my search parameter is wrong? On my trial function fetch if I use these: tickets = invokeurl [ url :"https://desk.zoho.com/api/v1/tickets/351081000145244764"
                                                                                                  • How to Parse XML Data Returned by API?

                                                                                                    I have several APIs integrated with my CRM and they work great. I am having some trouble though parsing data out of a large string/array in Funtions? I need to be able to pull the DeviceId and the WebSiteDeviceName from each PanelDevice. I would appreciate
                                                                                                  • Can the meeting location be specified by the customer?

                                                                                                    I own a painting company. I offer free estimates to customers, and I'd like them to be able to enter the meeting address in the booking form... so, the place they want me to give a painting estimate for. I need the customer to be able to tell me where
                                                                                                  • Zoho Bookings - Reserve with Google

                                                                                                    Does Zoho Bookings plan to to integrate with Reserve with Google?
                                                                                                  • Single use booking

                                                                                                    Hello everyone! It would be very interesting to be able to generate unique booking links. Once a booking is made through that link, it will no longer work. Calendly has something similar: https://help.calendly.com/hc/en-us/articles/1500001292022-How
                                                                                                  • Features Req: Service-Specific Calendar And Limit number of bookings per guest

                                                                                                    By The Grace of G-d. Hi, I Came across 2 features i believe more users would love to see added to the amazing bookings app: 1. Service-Specific Calendar I dont want to open my whole calendar to all of my services. For Example, Lets say i have a free consultation
                                                                                                  • Generating Discount Coupons for Zoho Bookings

                                                                                                    Hi, Is there provision to generate Discount Coupons for appointment bookings? I could not see that in the settings and this is very much needed. Please suggest us. Thanks
                                                                                                  • Quais são os maiores desafios que você enfrenta ao implementar o Zoho CRM?

                                                                                                    Olá, pessoal da comunidade Zoho Brasil! Sou parceiro autorizado da Zoho e, ao longo do tempo, tenho notado que cada implementação de CRM traz desafios únicos, dependendo do segmento de negócio, das metas da empresa e até da familiaridade da equipe com
                                                                                                  • Featured Blog Image Size

                                                                                                    What is the ideal size for the cover/featured image of a Zoho Sites blog? Because all our cover images are getting these black stripes horizontally or on the sides (look images)
                                                                                                  • Zoho CRM v2.1 deprecation or sunset plans ?

                                                                                                    Hi Team Wanted to know if there is any plan to deprecate v2.1 CRM apis https://www.zoho.com/crm/developer/docs/api/v2.1/ and if yes by when
                                                                                                  • Do I need to migrate to API v7?

                                                                                                    Current workload forces me to ask this question. Even though I know API v7 has better features, I have many previous API calls written in v2 that still function well. Is there any compelling reason (that I may be missing) for me to make time to migrate
                                                                                                  • Has anyone implemented OCR functionality as a text input method for the CRM?

                                                                                                    The users in my organisation are used to writing meeting notes using the pen and paper notebook. Asking them to enter those notes into the CRM is a chore and I suspect is a major hurdle for the digitalisation initiative to take off in this organisation.
                                                                                                  • way to change the interface language (e.g. to English) in the whole Zoho One ecosystem at once

                                                                                                    Hi everyone. I had a need to create a new Zoho One account for a new company. However, since I did it from Germany, I have defaulted to German language in Zoho One interface (in all apps). Can you please tell me if there is a way to change the interface
                                                                                                  • How Can I delete accounts or change type of account?

                                                                                                    My accountant has wrongly categorized many accounts as Other Assets instead of Accounts receivable while putting in opening balances. How can I delete an account or recategorize it?
                                                                                                  • How to have sub heads in Salary account

                                                                                                    Hi How can i have sub heads under salary account, we tried but it is not allowing us to create sub heads Thanks Alka
                                                                                                  • Can I give access of my Zoho Spreadsheet?

                                                                                                    Hello Everbody! I work with a travel and tourism company, and my job is to record the data of clients of the company. And I use zoho for my work. So my question is can I give access of my sheet to the clients and my company. Kindly guide me. Thankyo
                                                                                                  • Is it possible to display formulas in cells instead of calculated results?

                                                                                                    I want to export my Zoho sheet as tab separated text without losing the formulas. In excel, I would use the settings Options - Advanced - show formulas in cells instead of their calculated results then save as tab separated values. How do I do this in
                                                                                                  • Unsuscribe, suscribe and tell a friend links not working

                                                                                                    Hello, I'm new to Zoho campaigns. I created and sent a test campaign to myself but on clicking the subscribe, unsubscribe, view in browser ans tell a friend links, i realize none of them leads anywhere. Instead i get the following error:
                                                                                                  • Tip #5: Setting access rights at the subfolder level

                                                                                                    Hello everyone, We hope you're finding our WorkDrive Tips and Tricks series useful. For today's tip, we'll teach you how to assign higher subfolder permissions to Team Folder members. Team Folders helps you avoid the drawbacks of traditional file sharing.
                                                                                                  • Cross-Data Center Collaboration and / Or allowing users to choose DC

                                                                                                    Dear Zoho Cliq Support Team, We are writing to request a significant enhancement to Zoho Cliq that would greatly benefit our geographically dispersed development team. Current Challenge: Currently, Zoho Cliq automatically routes users to specific data
                                                                                                  • Creating stunning templates for appointment notification emails

                                                                                                    Good day folks! Can you guess what we are going to check out today? We have designed a few samples to showcase the power of customizable email notification templates. Template 1 Template 2 Template 3 Template 4 Template 5 Template 6 Template 7 Template
                                                                                                  • integrating Zoho CRM vendors with Zoho projects

                                                                                                    In most of our projects we collaborate with our Vendors. Being able to integrate only Accounts and not Vendors from CRM, is a huge limitation for our perspective and needs. We would really love to see this feature in the CRM-Projects integration.
                                                                                                  • Allocate emails to user in a shared mailbox

                                                                                                    Hi, This might be obvious, but I cannot find the answer. I have 3 shared mailboxes so any team member can see the emails. Is there a way of allocating a specific email to a user so that it is their responsibility to deal with it? Thanks in advance.
                                                                                                  • Multiple Vendor SKUs

                                                                                                    One of the big concerns we have with ZOHO Inventory is lack of Vendor Skus like many other inventory software packages offer. Being able to have multiple vendor skus for the same product would be HUGE! It would populate the appropriate vendor Sku for
                                                                                                  • Include SalesIQ activity when sending Forms data to CRM as a new Lead

                                                                                                    Is there a way that when I get a new lead via a zoho form on my website to include the activity in CRM? I have Sales IQ integrated with the form however, most of my leads do not talk to us through the chat fuction but they do fill out a zoho form. Id
                                                                                                  • Attendance Bulk Import Not working.

                                                                                                    It was working for me from last one year the same format. but now its giving bad request(400). Please help me. resolved this problem.
                                                                                                  • ZOho Booking and CRM integration.

                                                                                                    We are using Zoho Booking wiht Zoho CRM in a custom module. Inside our module we use the option to book a meeting with the customer. This part works great we feed the field to the URL and everything work 100%. Now my issue is that I was not able to find
                                                                                                  • Chrome browser issues. Anyone else?

                                                                                                    I am suddenly having multiple issues with Chrome browser interpreting the Zoho Mail interface.  Anyone else?  Any known problems? Thanks, Todd
                                                                                                  • 554 5.2.3 MailPolicy violation Error, help?

                                                                                                    This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. 554 5.2.3 MailPolicy violation Error delivering to mailboxes I am not sure why i am getting this, please
                                                                                                  • Display comma in number field (thousand separator)

                                                                                                    Love Zoho so far!  How can I add comma as thousand separator in number field upon input by user?  This is essential feature when dealing with larger numbers to make readable.  Is there number formatting script for this? For example, change 600000 to 600,000 This link appears to be related to the topic. https://help.zoho.com/portal/en/community/topic/amount-display#2266000001410984
                                                                                                  • Any way to Associate a Recurring Invoice with Deal/Potential in Zoho CRM

                                                                                                    When we create an Invoice in Zoho Books, we have the option to associate that invoice with a Potential/Deal that is tied to that same customer. Can we do the same thing with Recurring Invoices? When creating a Recurring Invoice, I want to be able to Associate
                                                                                                  • Next Page