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.




      • 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

        • Recent Topics

        • Adjusting Physical Inventory

          Not getting very far with support on this one, they say they are going to fix it but nothings happened since November. Please give this a thumbs up if you would like to see this feature or comment if you have some insight. Use Case: Inventory set to be
        • Print PO receipt

          Hi I would like to print the PO receipt. There does not seem to be any way to do this. I track batch numbers and printing the PO does not show this. Only the receipt would show the details of the receipt. Currently I print the screen which does not have
        • Create a purchase order in vendor's currency

          I am having a problem working this out and would appreciate some suggestions. We have Books and Inventory working in tandem. We are in Australia, our product is sold in Australia in $A and obviously all our invoices, accounts and reports need to be in
        • Work Orders / Bundle Requests

          Zoho Inventory needs a work order / bundle request system. This record would be analogous to a purchase order in the purchasing workflow or a sales order in the sales cycle. It would be non-journaling, but it would reserve the appropriate inventory of
        • Getting error during inserting a record in form of zoho people using zoho api

          import requests import json # Set your access token and Zoho People API base URL access_token = '1000.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX' api_base_url = 'https://people.zoho.in/people/api/' # Set the form name and data to be inserted form_link_name
        • Change script to add fields

          Hi, I have a custom function (writen by a different implementation company in the beginning) which I would like to edit to add a different field as well. Can't get it to work on my own though. - The script now adds the address fields to a new quote (needs
        • 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?
        • Revamped Print in Zoho Sheet—customized for paper

          The latest enhancements to Zoho Sheet's Print settings allows you to print a worksheet or a selected range, with customizations that make the data comprehensible, even on paper.   Customize header and footer Make your spreadsheets meaningful with a relevant header and footer. You can now choose to display the file name, sheet name, current page number, total pages, date, and time as the header and footer in your print view. Besides the predefined elements, you can also give a custom text for header/footer.
        • 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
        • 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 !
        • Unified customer portal login

          As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
        • message on click of button

          Hi, i added insert task on 'Quick view' below  'Action'  of report just below 'Delete' button,  so i am trying to add a message on click of button that, "This item is now added into Pending Request" like this .... So, how can i achieve this ; because
        • Is it possible to disable Chat Waiting Time, or to make it indefinite?

          We have used many online chat services over the years. However, Zoho's SalesIQ appears to be the only one we've tried that has a mandatory time limit where we must respond to new customer queries. We are a small business so we have no dedicated staff
        • Is Drawing feature supported in zoho Sheets?

          Is there any option to draw arrows and some basic shapes such as circle , rectangle etc in zoho sheets? if so, can someone help me find it 
        • Access CRM Variables from Formula field

          Is it possible to use a CRM variable (defined in Developer Space -> CRM Variables) in a formula field for calculations ?
        • Client Script: $Client.refresh({ triggerOnLoad: true }); not triggering onLoad Client Scripts

          Hey friends! I'm trying to store a temporary var, refresh the page for the user, then check that temporary var and do some actions. Theoretically using the title's code: $Client.refresh({ triggerOnLoad: true }); should refresh the page and trigger on
        • Super Admin login to delete certain folders and passwords and clearing the trash folder, they are still appearing on my dashboard

          Hi Zoho Team, I need help with an issue I've encountered. Despite using the Super Admin login to delete certain folders and passwords and clearing the trash folder, they are still appearing on my dashboard. I would like to understand why this is happening
        • Pulling Specific Products from Sales Orders in Books to a CRM Record

          We currently process orders directly through our website (woocommerce) as well as through manual sales orders in zoho books. When an order comes through the website, all of the individual products from that order show up in the CRM record of that customer.
        • Automatically add a retainer to every estimate

          Hi all, I've been trying to find a way to automatically add a retainer at a set % to every estimate we create and send. So far I haven't been successful, does anyone know of a way to do this? Thanks,
        • Clear String field based on the value of other field

          Hello everyone, We would like to be able to clear a string field (delete whatever has been written and make it empty) when another field (picklist) is changed to a specific value. While I can empty other types of fields, I noticed that I can't do this
        • Custom Deal Name in Lead Conversion Mapping

          I know there are ways to change the name of a Deal after conversion using a custom function, so no need to repost that information. I would like to see the CRM Improved with Deal Name Customisation and I think the Lead Conversion Mapping page would be
        • Within the Basic KPI component in Analytics, it is impossible to set "next" day range as a filter

          Hi there, I am currently setting up a deal dashboard for the Sales team. While it is possible to filter deal records to show records that were created LAST X days only, it looks like a NEXT X days Closing date filter is not available. Would it be possible
        • Invoice status on write-off is "Paid" - how do I change this to "Written off"

          HI guys, I want to write off a couple of outstanding invoices, but when I do this, the status of the invoices shows as "Paid". Clearly this is not the case and I need to be able to see that they are written off in the customer's history. Is there a way
        • For each loop with available time slots

          I am very new to Deluge, and this question was unable to be answered by Zoho Creator tech support upon request. Task at hand: I have a Form with 4 fields: - Date Start - Date End - Dropdown: Time Start: contains time slots (12:00PM, 12:15PM, etc) - Dropdown:
        • Can we have Backorder Management ?

          Can we have Backorder Management ?
        • Converting Amazon Sales Order to Invoice

          Hi there, We need  advice on the Amazon integration with Zoho Inventory. Now, we want to convert all the Sales orders synced from Amazon to Invoices. We want also to include and record the Amazon fees associated with the sales (Amazon fees, FBA fees, Cost of Advertising etc.) However, Sales order only captures the sales proceeds (Gross Sales) in Zoho Inventory. Does anyone currently work with Amazon and can suggest how to correctly process the sales and Amazon payments through Zoho Inventory and
        • Zoho Inventory | Can't uncheck/turn off Advance Tracking

          Hi, I wanted to know if there's a way to turn off Advanced Tracking (such as Serial Number or Batch Tracking) for an item in Zoho Inventory. I’ve read that you might need to delete associated transactions and clear the opening stock to disable these features.
        • Landed Cost application to Vendor Bills from dropship Purchase Orders

          When trying to apply a Landed Cost to a Vendor Bill generated from a dropship Purchase Order, the Landed Cost pop-up window generates a message that "Landed Cost cannot be applied to Bills from dropship Purchase Orders" when trying to save the landed
        • 2 serial numbers for 1 item (Mac address and Serial number)

          There is a way to track 2 serial number type for 1 Item. Ex: Some electronic devices have a MAC address and a serial number. I need to track those 2 numbers
        • Zoho Projects Roadshow, USA - 2024

          Dear Users, We are happy to announce the Zoho Projects Roadshows 2024 in USA. This is an excellent opportunity to learn more about Zoho Projects and gain in-depth knowledge of the advanced features. Our team will also discuss industry specific solutions
        • [Zoho Writer Webinar] Tips on collaboration control in Writer

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for the month of October 2023: Tips on collaboration control in Writer. This webinar will help you understand the various features available in Writer to control collaboration. We'll
        • [Zoho Writer Webinar] Working with tables in Zoho Writer

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for the month of September 2023: Working with tables. This webinar will help you understand the various ways you can use tables to meet your specific needs. The webinar will take
        • [Zoho Writer Webinar] Customize Writer to suit your business process

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for the month of August 2023: Customize Writer to suit your business process. This webinar will cover the various ways to customize Writer to streamline business processes and improve
        • Is there a way to print the dashboard?

          I would like the capability of printing the dashboard - is that possible?
        • Workflows for Timesheet

          Good day, Any way to have timesheet as triggers? I looked into Zoho Flow and into Zoho Project automation but no where can I have timesheet as a trigger. Basically, I would like to trigger something upon timesheet approval. Right now, the only way to
        • Linkedin - Recruiter System Connect

          Hi there! Does anyone here know how to connect Zoho Recruit to Linkedin Recruiter via Recruiter System Connect?
        • [Webinar] A recap of Zoho Writer in 2024

          Hi Zoho Writer users, We're excited to announce Zoho Writer's webinar for December 2024: A recap of Zoho Writer in 2024. This webinar will provide a recap of the features, enhancements, and integrations released in 2024 to enhance your productivity. There
        • Learn how to automate IT asset and incident management with Zoho Writer

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for November 2024: Learn how to use Zoho Writer's fillable forms for IT asset and incident management. This webinar will focus on how Zoho Writer can help you automate your organization's
        • [Webinar] Learn how Zoho Writer can streamline your finance and admin operations

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for October 2024: Streamlining finance and admin operations with Zoho Writer. This webinar will focus on how Zoho Writer can help you generate payslips and automate claim processes.
        • [Zoho Writer Webinar] Learn how Zoho Writer can enhance the productivity of sales teams

          Hi Zoho Writer users, We're excited to announce the Zoho Writer webinar for August 2024: Streamlining sales operations with Zoho Writer. This webinar will focus on how Zoho Writer can help you create sales documents and automate sales routines. There
        • Next Page