User Tips: Create a bot & have users chatting with ChatGPT in 30 seconds!

User Tips: Create a bot & have users chatting with ChatGPT in 30 seconds!

If you want your users to be able to chat 1-1 with a bot, this post is for you! This builds on the great post by Poorvik Palanikumar here that walked users through the process of creating a bot that could respond on a channel. If you followed that post and set everything up can can skip to "3." below and continue from there.

(The lazy instructions... Copy code below, create a bot, click "edit code" for the message handler & paste the code, insert your own token and save.)

To create & enable a bot to respond privately to user instead of on a channel follow the steps below.
  1. Create a bot. (Click your profile pic>Bots & Tools > "Create Bot" (top right)
  2. Name the Bot, add description and set it to "Organization" and Save
  3. Click "Edit Code" from the "Message Handler" section and delete the existing code (presuming you don't use it!)
  4. Paste in the code below and save. Make sure to add in your own token. Get one here
You're all set! Go and subscribe to your bot and ask it a question... you'll have to grant permissions from the popup message.

Message Handler Code: 
(Bots & Tools > Edit Handlers (for your bot) > Go to Message Handler & click "Edit Code")

response = Map();
//
//Reassign the inbound message from the user, which we'll send to ChatGPT
question = message;
//
//
// Need to add your OWN openAI token below. Replace the xxxxxxx with your own token
token = "Bearer xxxxxxxxxxxxxxxx";
//
//
header = Map();
header.put("Authorization", token);
header.put("Content-Type", "application/json");
//
//
//Set the params which we'll send to chatGPT
//Increasing the temperature increases response creativity, decreasing has the opposite affect
params = { "model": "text-davinci-003", "prompt": question, "temperature": 0.4, "top_p": 1
"max_tokens": 256, "frequency_penalty": 0, "presence_penalty": 0, "stop": { " Human:", " AI:"} };
//
//
// Making post request to ChatGPT
fetchCompletions = invokeurl
[
type: POST
parameters: params.toString()
headers: header
detailed: true
];
//
//
info "Fetch completions: " + fetchCompletions;
//
//
//Check we got a good response from ChatGPT
if (fetchCompletions.get("responseCode") == 200) {
// Grab the answer from Chat GPT
answer = fetchCompletions.get("responseText").get("choices").getJSON("text");
//
//
//Put the answer into the response map which is what we'll return to the user
response.put("text", answer);

}
else if (fetchCompletions.get("responseCode") == 429)
{
response = { "text": "Oops! I can't help with this. Try asking something else :wink:" };
}
//
//
// Trigger the response back to the user.
return response;


27 Second Gif... use the extra 3 seconds to set your own OpenAI "token" before you paste the code (get your token here)

 


Some FAQ:

Will this allow users to subscribe to a bot and ask it questions and get answers?
Yes but it is not the current ChatGTP version that everyone is raving about. It's the ChatGPT-3 Da-Vinci model which is excellent but not on the same level as ChatGTP-4 which is still in research mode and does not yet have an API connection.

Will it remember my previous questions?
It generally depends on how you phrase the questions and give the context. It's not on the same level as ChatGPT-4.

I asked it a question but it does not give me a great answer, why?
How you enter your "prompt" (question) is the important part. Generally the more context and instruction you give the better the answer. Google or YouTube  "ChatGPT Prompt Design" and you'll be an expert in no time. 

    • Sticky Posts

    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Convert a message on Cliq into a task on Zoho Connect

      Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
    • Cliq Bots - Post message to a bot using the command line!

      If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
    • Cliq Bots - How to make a bot respond to your messages?

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

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

    • Introducing Zia LLM: Zoho’s in-house Generative AI solution for CRM's AI capabilities

      Hello everyone, We're excited to announce the launch of our in-house Large Language Model (LLM) by Zia to power our AI offerings. What is LLM? LLM stands for Large Language Model, a powerful AI technology that processes and generates human-like text based
    • How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.

      How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.
    • Zoho Desk Validation Rule Using Custom Function

      Hi all, I tried to find the way to validate fields using custom function just like in Zoho CRM but to no avail. Is there a way to do this?
    • What do the Image Sizes mean in Zoho CRM Email Templates?

      Below you can see the image options in email templates: Banner, Fit, Small, Medium, Original, Custom. Can someone from Zoho please share with me: What each is/means? How each will look on desktop AND mobile? How to edit "custom"?  If I choose "Custom"
    • Archive Option in Conversation View

      Hello, I have a suggestion\request to add an "Archive Thread" button in conversation view of Zoho Mail. The best suggestion I have is to put an "Archive Thread" button next to the "Label Entire Thread" button in conversation view. Most users don't just
    • Possible to backdate Stage shifts in Deals module?

      I want to enter my organisation's historical dealflow data into the CRM and it's important that the Stage history is showing the correct dates in the past of when it happened. Is there a way for me to modify the "Modified Time" in the Stage History Related
    • Layout Prompt when creating an oportunity

      Hi There, Is there a way to create a pop-up prompt when I create a new Deal giving me the option of what layout to use based on a certain requirement? So, if the prompt had two options 1. is a new business Deal 2. is a renewal Deal Thanks in advance
    • Conditional layouts - support for multi-select picklists

      Hi, The documentation for conditional layouts says the following: "Layout Rules cannot be used on the following field types: Auto Number Lookup Multi Select Lookup User Lookup Formula File Upload Multi Line" I have a custom module with a multi-pick list
    • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

      Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory for
    • How to upload mass inventory quantity adjustment with batch number?

      I wanted to clean-up our inventory list; however, I have trouble performing the task as I don't know how to mass upload inventory adjustment with batch numbers. I don't want to do it manually as there are if not thousands at hundreds of inventory tr
    • Product sale report with margins

      we unable to get the data as per product sale report with margins so we need help in this
    • Amazon.in FBA multiple warehouse integration with Zoho Inventory

      My organisation subscribed to Zoho One looking at the opportunity to integrate Amazon.in with Inventory. But during the configuration, we understood the integration has severe limitations when it involves multiple warehouses in the same Organisation.
    • CLIENT PORTAL (If clients can place orders directly on the portal)

      Zoho client portal is excellent. Everything is there except one thing. Client should be able to place orders directly on the portal. This would enhance the portal and end users will be extremely happy. This suggestion infact came from one of our client.
    • Is there provision to charge the attendees to join the webinar?

      We want to host some webinar of public interest and want to charge them to participate in this. Does this feature in-build in the application? Offcourse, we will be having Razor pay account activated for these purpose.
    • Zoho Vault App for Windows

      Hello, is there a Windows app that can be used to access the passwords saved in Zoho Vault? Thank you
    • Emails take up to 14 hours to arrive and often never arrive at all.

      I've been on hold on your support phone for two hours. I spent an hour waiting to talk to somebody somebody finally picked up. They asked me to give them my ID number and when I found it, they were gone they didn't hang up. They just walked away from
    • Emails take up to 14 hours to arrive and often never arrive at all.

      I've been on hold on your support phone for two hours. I spent an hour waiting to talk to somebody somebody finally picked up. They asked me to give them my ID number and when I found it, they were gone they didn't hang up. They just walked away from
    • 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
    • "We’ve fine-tuned Zoho Inventory..."

      Every day I have this message at the top of my screen. I hit refresh everyday and then the next I see it again. What is being "fine-tuned" on a daily basis?
    • How can the direct link to a ticket be created from ticket #?

      Our agents will be using ZDesk but we will have to create direct link to tickets in another ERP by providing the Desk Ticket # Is there a way to create the direkt links from the ticket # alone? Do we have to use the API to get the direct links?
    • Allow standard layout to be used/edited as a starting point for canvas

      Hello, I would really love to improve the look of our CRM interface using Canvas but we have spent so much time customising the screens already (in standard view) that the thought of starting from scratch and building everything again, field by field,
    • How to link to/displaya png stored in workdrive in a Creator HTML snippet?

      How to link to/display png stored in workdrive in a Creator HTML snippet? I've tried it as a plain external link and as an iframe. The iframe works but is kinda slow...and I'd prefer to be able to do finer-grained positioning but referencing the png as
    • Has anyone built a ticket export that allows Help Center users to export the tickets shown in the My Area list they are looking at?

      Hi, We are moving to Zoho Desk soon. Our current support system displays an option in our help center allowing customers to export their Open, Closed, or all tickets based on which list they are looking at. We need to offer the same in Zoho Desk help
    • Contemplating moving my site from WordPress to Zoho Sites

      Hi Everyone, We currently find ourselves in a situation where we ant to review and update our current sites content. We are small business owners, not developers. We currently use a wide range of Zoho products. We sometimes think about the possibility of either moving or just starting from scratch on Zoho Sites. I would like to know if anyone has done this and of course the things that need to be considered. We have spent quite a bit of time getting our current site positioned organically and I guess
    • Using AVG in SQL Query

      My current SQL Query is: SELECT "Client Info", avg("Revenue") FROM "Funded Deals" GROUP BY "Client Info" The current table that this is creating: Client Info avg(Revenue) Previous 4175 1st - New 3411 1st - Old 3013 Renew 3069 While this works as I had
    • 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
    • Tracking Implementations

      We create Opportunities (Renamed Deals) with associated Quotes (renamed Products and Services). When we close the deal, we want to be able to track the implementation of each product separately. For instance, the client may have ordered Item A, Item B
    • Is this link the transparent pixel used to track opens?

      Could someone please help me identify this highlighted link? It is automatically created by Zoho and a lot of contacts receiving campaigns will click on this link. I don't believe that it is the "update your preferences link" because on the Link Clicks
    • Zoho desk desktop application

      does zoho desk has a destop applicaion?
    • How can I view Help Center articles in 'Sandbox' mode?

      I have published some help center articles but when I try to preview the knowledge base page, it says 'We have no content to display'.
    • Is this possible with Campaigns?

      My company is currently moving CRM's from Monday to Zoho One. Currently, our marketing lead process is send out 7 sms messages over 14 days if the lead is in a certain status. If we don't get a response the lead is put into a "Closed" status. Do we buy
    • Tracking leads through the sales process

      Our leads are being generated via paid google ads and are arriving to us with UTM data showing lead sources, campaign mediums and campaign names. I want to track the progress of those leads as they migrate through our sales funnel while maintaining a
    • Error 403: Forbidden When Updating Email Signature via API

      Hi Zoho Desk team, First, congratulations again on the excellent Zoho API. But, I’m encountering an issue while attempting to update an email signature via the API. Whenever I make a request to update the signature, the response returns an HTTP 403 Forbidden
    • Opening & working multiple tickets

      We work in multiple tickets at the same time. Currently to do this, we have to open multiple instances of Desk.  Is there a way to do this by just opening multiple ticket tabs within 1 instance of Desk?  
    • Different content per social media account..

      Is there a way to add different content per social media account on one post?
    • Merge tickets

      Hello, I am attempting to merge two tickets; however, the option to merge does not appear to be available. Could you kindly confirm if this feature has been relocated or removed? Additionally, could you please provide guidance on the correct process to
    • Add "Merge by Ticket ID" Option on Ticket Screen

      Dear Zoho Team, We would like to request a new feature for the ticket interface in Zoho Desk. Specifically, we propose adding a button to the ticket screen that allows users to merge the current ticket with another ticket by directly providing the second
    • Using tickets to train Zia

      Hi Team, I would like to know if there is any way that Zia can also learn from previous tickets in addition to the articles from the knowledge base. Since we have most of our knowledge curerently in the tickets and that this is hard to combine into a
    • Unable to delete Junk Lead and Not Qualified from the Lead Status field

      Are Junk Lead and Not Qualified default fields or something that cannot be deleted? I have gone into the Leads module and made sure there are no records using these values. Other values have a minus sign that allows me to remove them, but these two fields do not have that option.
    • Welcome Link Expired

      Hi The links sent to the users didn't get clicked on in time and now all the links have expired. Is there a way to send a new link without deleting them and re-adding them>
    • Next Page