Webinar : From metrics to meaningful communication - Register now

Skip to product menu
close
EXPLORE ALL PRODUCTS

Sales

CRM

Comprehensive CRM platform for customer-facing teams.

CRM
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
Thrive

Complete loyalty and affiliate management platform.

Thrive
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Social

All-in-one social media management software.

Social
Survey

Design surveys to reach and interact with your audience.

Survey
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Sites

Online website builder with extensive customisation options.

Sites
Backstage

End-to-end event management software.

Backstage
PageSense

Website conversion optimization and personalisation platform.

PageSense
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
Webinar

Webinar platform for webcasting online webinars.

Webinar
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
NEW
Domains

Easy domain registration, transfer, and secured DNS management.

Domains
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
Thrive

Complete loyalty and affiliate management platform.

Thrive
Publish

Manage all your local business listings on a single platform.

Publish
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

Desk

Helpdesk software to deliver great customer support.

Desk
Assist

Remote support and unattended remote access software.

Assist
Voice

Cloud Contact Center Software for businesses.

Voice
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
FSM

End-to-end field service management platform for service businesses.

FSM
Lens

Interactive remote assistance software with augmented reality.

Lens
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

Books

Powerful accounting platform for growing businesses.

Books
Expense

Effortless expense reporting platform.

Expense
Sign

Digital signature app for businesses.

Sign
Inventory

Powerful stock management and inventory control software.

Inventory
FREE
Invoice

100% Free invoicing solution.

Invoice
Billing

End-to-end billing solution for your business.

Billing
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Commerce

eCommerce platform to manage and market your online store.

Commerce
Checkout

Collect payments online with custom branded pages.

Checkout
Practice

Practice management software for accounting firms.

Practice
Solo

The all-in-one toolkit for solopreneurs.

Solo
NEW
Payments

Unified payment solution built for all businesses.

Payments
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email, Storage, and Collaboration

Mail

Secure email service for teams of all sizes.

Mail
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
WorkDrive

Online file management for teams.

WorkDrive
Bookings

Appointment scheduling app for consultations with customers.

Bookings
Cliq

Stay in touch with teams no matter where you are.

Cliq
Notebook

Beautiful home for all your notes.

Notebook
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
Learn

Knowledge and learning management platform.

Learn
Office Integrator

Built in document editors for web apps.

Office Integrator
Writer

Word processor for focused writing and discussions.

Writer
TeamInbox

Shared inboxes for teams.

TeamInbox
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Show

Create, edit, and share slides with a sleek presentation app.

Show
Tables

Work management tool to connect people, processes, and information.

Tables
Sheet

Spreadsheet software for collaborative teams.

Sheet
Office Suite

Powerful collaborative work platform for teams.

Office Suite
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
ToDo

Collaborative task management for individuals and teams.

ToDo
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

Expense

Effortless expense reporting platform.

Expense
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
People

Organize, automate, and simplify your HR processes.

People
Sign

Digital signature app for businesses.

Sign
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Shifts

Employee scheduling and time tracking app.

Shifts
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

Creator

Build custom apps to simplify business processes.

Creator
Assist

Remote support and unattended remote access software.

Assist
Vault

Online password manager for teams.

Vault
Directory

Workforce identity and access management solution for cloud businesses.

Directory
Lens

Interactive remote assistance software with augmented reality.

Lens
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
eProtect

Comprehensive email security and archiving for every business.

eProtect
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit

BI and Analytics

Analytics

Modern self-service BI and analytics platform.

Analytics
DataPrep

AI-powered ETL tool for effective data integration and movement.

DataPrep
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI

Project Management

Projects

Manage, track, and collaborate on projects with teams.

Projects
Sprints

Planning and tracking tool for scrum teams.

Sprints
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Projects Plus

Unified project management platform for intelligent, data-driven work.

Projects Plus

Developer Platforms

Creator

Build custom apps to simplify business processes.

Creator
Flow

Automate business workflows by creating smart integrations.

Flow
Office Integrator

Built in document editors for web apps.

Office Integrator
DataPrep

AI-powered ETL tool for effective data integration and movement.

DataPrep
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Tables

Work management tool to connect people, processes, and information.

Tables
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
Apptics

Application analytics for all apps.

Apptics
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI

IoT

NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
Projects Plus

Unified project management platform for intelligent, data-driven work.

Try now
Projects Plus
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Skip to main content

Catalyst Type Extension

Catalyst Integration in Cliq allows you to integrate Cliq components with Catalyst for custom-built coding functions that contain the intense business logic of a Cliq Extension. By integrating catalyst with Cliq, you can code your business logic of any development platform that is supported via Catalyst, in Java or Node.js platform. When a particular feature is accessed in the external service, Catalyst automatically invokes the execution of the Integration function coded in Catalyst through an HTTP call.

Catalyst Integration Functions can bundle the following Cliq internal tools: 

  • Bots: Conversational interface that handles tasks or responds to queries
  • Commands: Slash commands that perform custom actions
  • Message Actions: Actions that are performed as the response to individual messages
  • Widgets: Enables you to customize your Cliq home screen
  • Functions: Custom functions that can execute tasks based on event occurrences

You can learn more about these internal tools and extensions from the Cliq developer documentation.

 Creating a project in Catalyst 

To create a project in Catalyst navigate to https://cliq.zoho.com/developer.

  • Click on Create Extension button.
  • Enter the name and the description of the project.
  • Select execution type as Catalyst Function.
  • Click on Create Project. Clicking on it will navigate you to the catalyst project page, where you can create a new project.

Creating a function in Catalyst

  • To create a function enter the name and the description of the extension you want to create.
  • Select execution type as Catalyst Function.
  • Select a project from the project dropdown or create a new project by clicking on Create project.
  • Click on Create Function, once you click on it, you will see a popup with the necessary CLI command to initialize a Catalyst Function.
  • You can create a function either by executing this command line in the terminal or by accessing your project and selecting Functions, present under COMPUTE in the left-hand side menu.
  • Click on Create Function.
  • Select function type as Integration.
  • Select Zoho Cliq as a service.
  • Choose your preferred stack.
  • Click Create.

 Integrating Catalyst with Cliq 

  • Once you have created a project and a function, add the required components by clicking on the + icon.
  • Activate or deactivate the installation flow as per your requirement.
  • Click on Create Extension.

This will integrate Catalyst with Cliq and enable the Integration function to be executed each time Cliq components bundled with the extensions are accessed.

Catalyst configuration :

catalyst-config.json will be used to associate the Cliq handler with the Catalyst executor class/function.

Java:


//$Id$
package com.handlers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONObject;
import com.zc.cliq.enums.ACTION_TYPE;
import com.zc.cliq.enums.BUTTON_TYPE;
import com.zc.cliq.enums.SLIDE_TYPE;
import com.zc.cliq.interfaces.BotHandler;
import com.zc.cliq.objects.Action;
import com.zc.cliq.objects.ActionData;
import com.zc.cliq.objects.BotContext;
import com.zc.cliq.objects.BotContextParam;
import com.zc.cliq.objects.BotSuggestion;
import com.zc.cliq.objects.ButtonObject;
import com.zc.cliq.objects.CardDetails;
import com.zc.cliq.objects.MessageBuilder;
import com.zc.cliq.objects.Slide;
import com.zc.cliq.requests.BotContextHandlerRequest;
import com.zc.cliq.requests.BotMentionHandlerRequest;
import com.zc.cliq.requests.BotMenuActionHandlerRequest;
import com.zc.cliq.requests.BotMessageHandlerRequest;
import com.zc.cliq.requests.BotWebhookHandlerRequest;
import com.zc.cliq.requests.BotWelcomeHandlerRequest;
import com.zc.cliq.util.ZCCliqUtil;

public class BotClass implements BotHandler
{
 Logger LOGGER = Logger.getLogger(BotClass.class.getName());
 
 @Override
 public Map welcomeHandler(BotWelcomeHandlerRequest req) {
  Map resp = new HashMap();
  resp.put("text", "Hello " + req.getUser().getFirstName() + ". Thank you for subscribing :smile:");
  return resp;
 }
 
 @Override
 public Map messageHandler(BotMessageHandlerRequest req) {
  try{
   
  String message = req.getMessage();
  Map resp = new HashMap();
  
  String text;
  if(message.equalsIgnoreCase("hi") || message.equalsIgnoreCase("hey")){
   text = "Hi " + req.getUser().getFirstName() + " :smile:. How are you doing?";
   BotSuggestion suggestion = BotSuggestion.getInstance();
   suggestion.addSuggestion("Good");
   suggestion.addSuggestion("Not bad");
   suggestion.addSuggestion("Meh");
   suggestion.addSuggestion("Worst");
   resp.put("suggestions", suggestion);
  }
  else if(message.equalsIgnoreCase("Good") || message.equalsIgnoreCase("Not bad")){
   text = "That's glad to hear :smile:";
  }
  else if(message.equalsIgnoreCase("Meh") || message.equalsIgnoreCase("Worst")){
   text = "Oops! Don't you worry. Your day is definitely going to get better. :grinning:";
  }
  else if(message.equalsIgnoreCase("details")){
   text = "Welcome to details collection center :wink:";
   
   BotContext context = BotContext.getInstance();
   context.setId("personal_details");
   context.setTimeout(300);
   
   BotContextParam param1 = BotContextParam.getInstance();
   param1.setName("name");
   param1.setQuestion("Please enter your name: ");
   
   BotContextParam param2 = BotContextParam.getInstance();
   param2.setName("dept");
   param2.setQuestion("Please enter your department: ");
   param2.addSuggestion("CSE");
   param2.addSuggestion("IT");
   param2.addSuggestion("MECH");
   
   context.setParams(param1, param2);
   resp.put("context", context);
  }
  else{
   text = "Oops! Sorry, I'm not programmed yet to do this :sad:";
  }
  
  resp.put("text", text);
  return resp;
  
  }
  catch(Exception ex){
   LOGGER.log(Level.SEVERE, "Exception in message handler. ", ex);
   throw ex;
  }
 }
 
 @Override
 public Map contextHandler(BotContextHandlerRequest req) {
  
  Map resp = new HashMap();
  if(req.getContextId().equals("personal_details")){
   Map answers = req.getAnswers();
   StringBuilder str = new StringBuilder();
   str.append("Name: ").append(answers.get("name")).append("\n");
   str.append("Department: ").append(answers.get("dept")).append("\n");
   
   resp.put("text", "Nice ! I have collected your info: \n" + str.toString());
  }
  return resp;
 }

 @Override
 public Map mentionHandler(BotMentionHandlerRequest req)
 {
  String text = "Hey *" + req.getUser().getFirstName() + "*, thanks for mentioning me here. I'm from Catalyst city";
  Map resp = new HashMap();
  resp.put("text", text);
  return resp;
 }

 @Override
 public Map menuActionHandler(BotMenuActionHandlerRequest req) {
  Map resp = new HashMap();
  String text;
  if(req.getActionName().equals("Say Hi")){
   text = "Hi";
  }
  else if(req.getActionName().equals("Look Angry")){
   text = ":angry:";
  }
  else{
   text = "Action Press :fist:";
  }
  resp.put("text", text);
  return resp;
 }

 @Override
 public Map webhookHandler(BotWebhookHandlerRequest req) throws Exception
 { 
  // For incoming mails in ZohoMail
  JSONObject reqBody = req.getBody();
  String summary;
  String bodyStr = new StringBuilder("*From*: ").append(reqBody.getString("fromAddress"))
      .append("\n*Subject*: ").append(reqBody.getString("subject"))
      .append("\n*Content*: ").append((summary=reqBody.getString("summary")).length() > 100 ? summary.substring(0, 100) : summary).toString();
  MessageBuilder msg = MessageBuilder.getInstance(bodyStr);
  msg.setBot("PostPerson", "https://previews.123rf.com/images/nastyatrel/nastyatrel2006/nastyatrel200600035/149438272-flat-vector-illustration-chat-bot-icon-flat-line-style-vector-.jpg");
  CardDetails card = CardDetails.getInstance();
  card.setTitle("New Mail");
  card.setThumbnail("https://seekicon.com/free-icon-download/mail-icon_18.svg");
  msg.setCard(card);
  
  ButtonObject button = new ButtonObject();
  button.setLabel("Open mail");
  button.setType(BUTTON_TYPE.GREEN_OUTLINE);
  button.setHint("Click to open the mail in a new tab");
  Action action  = new Action();
  action.setType(ACTION_TYPE.OPEN_URL);
  ActionData actionData = new ActionData();
  actionData.setWeb("https://mail.zoho.com/zm/#mail/folder/inbox/p/" + reqBody.getLong("messageId"));
  action.setData(actionData);
  button.setAction(action);
  
  msg.addButton(button);
  
  Slide gifSlide = Slide.getInstance();
  gifSlide.setType(SLIDE_TYPE.IMAGES);
  gifSlide.setTitle("");
  List obj = new ArrayList(){{add("https://media.giphy.com/media/efyEShk2FJ9X2Kpd7V/giphy.gif");}};
  gifSlide.setData(obj);
  
  msg.addSlide(gifSlide);
  
  return ZCCliqUtil.toMap(msg);
 }
}

Download full source code (Default code - Java)
To try out this extension you can install it from here

Node.js function :


const cliq = require('zcatalyst-integ-cliq');
const command = cliq.command();
const https = require('https');

command.executionHandler(async (req, res) => {
    let text;
    const commandName = req.name;
    if(comp(commandName, 'catalystquote')) {
        try {
            text = await getQuote();
        } catch(err) {
            console.error('Exception while getting quote from third-party API. ' + err);
            text = 'Error while fetching quote!';
        }
    }
    else if (comp(commandName, 'catalystresource')) {
        const suggestions = req.selections;
        if(suggestions === undefined || suggestions.length === 0) {
            text = 'Please select a suggestion from the command';
        }
        else {
            const prefix = 'Take a look at our ';
            if(comp(suggestions[0].title, 'API doc')) {
                text = prefix + '[API Documentation](https://www.zoho.com/catalyst/help/api/introduction/overview.html)';
            }
            else if (comp(suggestions[0].title, 'CLI doc')) {
                text = prefix + '[CLI Documentation](https://www.zoho.com/catalyst/help/cli-command-reference.html)';
            }
            else {
                text = prefix + '[help documentation](https://www.zoho.com/catalyst/help/)';
            }
        }
    }
    else if(comp(commandName, 'getform')) {      
        return getForm();
    }
    else {
        text = 'Command executed successfully!';
    }
    res.text = text;
    return res;
});

command.suggestionHandler(async (req, res) => {
    if(comp(req.name,'catalystresource')) {
        const suggestion1 = command.newCommandSugestion();
        suggestion1.title = 'API doc';
        suggestion1.description = 'Catalyst API documentation';
        suggestion1.imageurl = '/sites/zweb/images/product-home-page/catalyst-icon.png';

        const suggestion2 = command.newCommandSugestion();
        suggestion2.title = 'CLI doc';
        suggestion2.description = 'Catalyst CLI documentation';
        suggestion2.imageurl = '/sites/zweb/images/product-home-page/catalyst-icon.png';

        const suggestion3 = command.newCommandSugestion();
        suggestion3.title = 'Help docs';
        suggestion3.description = 'Catalyst help documentation';
        suggestion3.imageurl = '/sites/zweb/images/product-home-page/catalyst-icon.png';

        res.push(suggestion1,suggestion2,suggestion3);
        return res;
    }
});

async function getQuote() {
    return new Promise((resolve, reject) => {
        let responseBuffer = [];
        const options = {
            hostname: 'quote.com',
            path: '/api/v3/quotes/random',
            method: 'GET'
          };
        const req = https.request(options, res => {
            res.on('data', (d) => {
                responseBuffer.push(d);
            });
            res.on('error', (err) => {
                if(req.aborted) {
                    return;
                }
                reject(err);
            })
            res.on('end', () => {
                try {
                    const responseData = Buffer.concat(responseBuffer);
                    const data = JSON.parse(responseData.toString('utf-8')).data[0];
                    const quote = data.quoteText + '\n\nAuthor: ' + data.quoteAuthor 
                    + '\nGenere: ' + data.quoteGenre;
                    resolve(quote);
                }
                catch(err) {
                    reject(err);
                }
            });
        });
        req.on('error', error => {
            if(req.aborted) {
                return;
            }
            reject(err);
        });

        req.end();
    });
}

function getForm() {
    const form = command.newHandlerResponse().newForm();
    form.title = 'Asset Request';
    form.hint = 'Raise your asset request';
    form.name = 'ID';
    form.button_label = 'Raise Request';
    form.version = 1;

    const actions = form.newFormActionsObject();
    actions.submit = actions.newFormAction('formFunctionLatest');// ** ENTER YOUR FORM FUNCTION NAME HERE **

    form.actions = actions;

    const userName = form.newFormInput();
    userName.type = 'text';
    userName.name = 'username';
    userName.label = 'Name';
    userName.hint = 'Please enter your name';
    userName.placeholder = 'John Reese';
    userName.mandatory = true;
    userName.value = 'Harold Finch';
    form.addInputs(userName);

    const email = form.newFormInput();
    email.type = 'text';
    email.format = 'email';
    email.name = 'email';
    email.label = 'Email';
    email.hint = 'Enter your email address';
    email.placeholder = "johnreese@poi.com";
    email.mandatory = true;
    email.value = "haroldfinch@samaritan.com";
    const assetType = form.newFormInput();
    assetType.type = 'select';
    assetType.trigger_on_change = true;
    assetType.name = 'asset-type';
    assetType.label = "Asset Type";
    assetType.hint = "Choose your request asset type";
    assetType.placeholder = "Mobile";
    assetType.mandatory = true;   
    assetType.addOption(assetType.newFormValue('Laptop', 'laptop'));
    assetType.addOption(assetType.newFormValue('Mobile', 'mobile'));
    form.addInputs(email, assetType);
    return form;
}

function comp(var1, var2) {
    return var1.toUpperCase() === var2.toUpperCase();
}

Download full source code (Default code - Node.js)
To try out this extension you can install it from here