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

Extension Incoming Webhook Handler

Integration with external applications can be done with the help of incoming webhook APIs. An extension token or ZAPI key generated by each user interacting with the extension, should be used for handling incoming webhooks and messaging apis. You will get the below given list of attributes when the extension's incoming webhook handler is executed:

AttributeDescription
headersHeader details from the request made to the server.
parametersParameter details from the request made to the server.
bodyRequest body as the type string.
http_methodGET | PUT | POST | DELETE
userDetails of the user triggering the handler.
ZAPI key (zapi key)The authtoken generated by each user interacting with the extension.
App key (appkey)This market place app key provided once the extension is created.

User Scenario

Let us consider an extension integrating GitLab and Cliq.  The installation validator authorizes the user to install the extension upon checking if they have an account in GitLab. The handler is triggered to activate the installed extension.  Following this installation and activation, the extension's webhook endpoints are configured by through a slash command. 

Note:

Configuring an extension's incoming webhook endpoint can be done through the following internal components - Slash Command, Bot, Message Action. 

Setting up webhooks in the GitLab for Cliq Extension

Create a slash command to configure webhooks for all your GitLab projects. Executing the command will return the token generation button as response. On clicking this button, each user will generate an extension token (ZAPI Key). The function associated with this button will register the webhooks for all GitLab projects present in your account. 

Slash command execution code


response = Map();
response = {"text":"Click on the token generation button below!","buttons":[
  {
    "label": "Create Webhook",
    "type": "+",
    "action": {
      "type": "invoke.function",
      "data": {
        "name": "authenticate"
      },
     "confirm":{
     "title":"Generate Webhooks for a GitLab Project",
      "description":"Connect to GitLab Projects from within Cliq",
       "input" : 
         {"type":"user_webhook_token"
		 }
	 }
    }
  }
  ]};
return response;

Button Function Code


response = Map();
info arguments;
token = arguments.get("input").get("token");
info token;
git_projects = invokeurl
[
	url :"https://gitlab.com/api/v4/projects?visibility=private&simple=true"
	type :GET
	connection:"ENTER YOUR CONNECTION NAME"
];
info git_projects;
for each  project in git_projects
{
info "here";
	projectID = project.get("id");
	info projectID;
	paramsMap = Map();
	paramsMap = {"url":"https://cliq.zoho.com/api/v2/applications/"+APPID+"/incoming?appkey="+APPKEY+"&zapikey=" +token,"id":projectID,"push_events":true,"issues_events":true,"note_events":true,"merge_requests_events":true};
	createWebhook = invokeurl
	[
		url :"https://gitlab.com/api/v4/projects/" + projectID + "/hooks"
		type :POST
		parameters:paramsMap
		connection:"ENTER YOUR CONNECTION NAME"
	];
	}
info createWebhook;
return response;

Extension Incoming Webhook Endpoint Workflow

The custom callbacks directed to the extension's incoming webhook endpoint should be handled in the extension's incoming webhook handler. The JSON response from the third party application will be passed as headers, parameters or in the body attribute. In this example, the response is available in the body parameter. The extension's webhook endpoint is called for any event update or change made in a GitLab project. According to the response received, a message is configured and posted to a channel of your choice. 


info body;
result = body.toMap();
if(result.get("object_kind") == "issue" && result.get("object_attributes").get("action") == "open")
{
	name = body.get("user").get("name");
	title = result.get("object_attributes").get("title");
	project = result.get("project").get("name");
	state = result.get("object_attributes").get("state");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.get("object_attributes").get("due_date") == "null")
	{
		duedate = "Null";
	}
	else
	{
		duedate = result.get("object_attributes").get("due_date");
		dateandtime = duedate.toTime("yyyy-MM-dd HH:mm:ss","UTC");
		duedate = dateandtime.toString("dd-MMM-yyyy hh:mm a",user.get("timezone"));
	}
	if(result.containKey("assignees"))
	{
		assignee = result.get("assignees").getJSON("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	response = {"text":"### :bug: Issue has been created by '" + name + "' in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nState: " + state + "\nProject: " + project + "\nAssignee: " + assignee + "\nDue date: " + duedate,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "issue" && result.get("object_attributes").get("action") == "reopen")
{
	name = body.get("user").get("name");
	title = result.get("object_attributes").get("title");
	project = result.get("project").get("name");
	state = result.get("object_attributes").get("state");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.get("object_attributes").get("due_date") == "null")
	{
		duedate = "Null";
	}
	else
	{
		duedate = result.get("object_attributes").get("due_date");
		dateandtime = duedate.toTime("yyyy-MM-dd HH:mm:ss","UTC");
		duedate = dateandtime.toString("dd-MMM-yyyy hh:mm a",user.get("timezone"));
	}
	if(result.containKey("assignees"))
	{
		assignee = result.get("assignees").getJSON("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	response = {"text":"### :bug: Issue has been reopened by '" + name + "' in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nState: " + state + "\nProject: " + project + "\nAssignee: " + assignee + "\nDue date: " + duedate,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "issue" && result.get("object_attributes").get("action") == "update")
{
	name = body.get("user").get("name");
	title = result.get("object_attributes").get("title");
	project = result.get("project").get("name");
	state = result.get("object_attributes").get("state");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.get("object_attributes").get("due_date") == "null")
	{
		duedate = "Null";
	}
	else
	{
		duedate = result.get("object_attributes").get("due_date");
		dateandtime = duedate.toTime("yyyy-MM-dd HH:mm:ss","UTC");
		duedate = dateandtime.toString("dd-MMM-yyyy hh:mm a",user.get("timezone"));
	}
	if(result.containKey("assignees"))
	{
		assignee = result.get("assignees").getJSON("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	response = {"text":"### :bug: Issue has been updated by '" + name + "' in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nState: " + state + "\nProject: " + project + "\nAssignee: " + assignee + "\nDue date: " + duedate,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "issue" && result.get("object_attributes").get("action") == "close")
{
	name = body.get("user").get("name");
	title = result.get("object_attributes").get("title");
	project = result.get("project").get("name");
	state = result.get("object_attributes").get("state");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.get("object_attributes").get("due_date") == "null")
	{
		duedate = "Null";
	}
	else
	{
		duedate = result.get("object_attributes").get("due_date");
		dateandtime = duedate.toTime("yyyy-MM-dd HH:mm:ss","UTC");
		duedate = dateandtime.toString("dd-MMM-yyyy hh:mm a",user.get("timezone"));
	}
	if(result.containKey("assignees"))
	{
		assignee = result.get("assignees").getJSON("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	response = {"text":"### :bug: Issue has been closed by '" + name + "' in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nState: " + state + "\nProject: " + project + "\nAssignee: " + assignee + "\nDue date: " + duedate,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "push")
{
	username = result.get("user_name");
	//name = result.get("commits").getJSON("author").get("name");
	msg = result.get("commits").getJSON("message");
	url = result.get("commits").getJSON("url");
	repository = result.get("repository").get("name");
	response = {"text":"*'" + username + "'* has made a commit  [" + msg + "](" + url + ")  in the repository *'" + repository + "'*","card":{"theme":"3","title":" Commit changes"}};
}
else if(result.get("object_kind") == "note")
{
	username = result.get("user").get("name");
	//name = result.get("commits").getJSON("author").get("name");
	msg = result.get("object_attributes").get("note");
	url = result.get("object_attributes").get("url");
	repository = result.get("repository").get("name");
	commitname = result.get("commit").get("message");
	response = {"text":"*'" + username + "'* has added a comment  [" + msg + "](" + url + ") for the commit *'" + commitname + "'* in the repository *'" + repository + "'*","card":{"theme":"3","title":":task: Comment Added for a Commit"}};
}
else if(result.get("object_kind") == "merge_request" && result.get("object_attributes").get("action") == "open")
{
	title = result.get("object_attributes").get("title");
	project = result.get("project").get("name");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.containKey("assignee"))
	{
		assignee = result.get("assignee").get("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	sourcebranch = result.get("changes").get("source_branch").get("current");
	targetbranch = result.get("changes").get("target_branch").get("current");
	response = {"text":"### New merge request in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nSource branch: " + sourcebranch + "\nTarget branch: " + targetbranch + "\nAssignee: " + assignee,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "merge_request" && result.get("object_attributes").get("action") == "close")
{
	title = result.get("object_attributes").get("title");
	//project = result.get("project").get("name");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.containKey("assignee"))
	{
		assignee = result.get("assignee").get("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	sourcebranch = result.get("object_attributes").get("source_branch");
	targetbranch = result.get("object_attributes").get("target_branch");
	response = {"text":"### Merge request has been closed in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nSource branch: " + sourcebranch + "\nTarget branch: " + targetbranch + "\nAssignee: " + assignee,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "merge_request" && result.get("object_attributes").get("action") == "reopen")
{
	title = result.get("object_attributes").get("title");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.containKey("assignee"))
	{
		assignee = result.get("assignee").get("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	sourcebranch = result.get("object_attributes").get("source_branch");
	targetbranch = result.get("object_attributes").get("target_branch");
	response = {"text":"### Merge request has been reopened in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nSource branch: " + sourcebranch + "\nTarget branch: " + targetbranch + "\nAssignee: " + assignee,"card":{"theme":"1"}};
}
else if(result.get("object_kind") == "merge_request" && result.get("object_attributes").get("action") == "update")
{
	title = result.get("object_attributes").get("title");
	repository = result.get("repository").get("name");
	url = result.get("object_attributes").get("url");
	if(result.containKey("assignee"))
	{
		assignee = result.get("assignee").get("name");
		info assignee;
	}
	else
	{
		assignee = "No assignee";
	}
	sourcebranch = result.get("object_attributes").get("source_branch");
	targetbranch = result.get("object_attributes").get("target_branch");
	response = {"text":"### Merge request has been updated in the repository '" + repository + "' \n\n*Details are as follows:*\nTitle: [" + title + "](" + url + ") \nSource branch: " + sourcebranch + "\nTarget branch: " + targetbranch + "\nAssignee: " + assignee,"card":{"theme":"1"}};
}
zoho.cliq.postToChannel("ENTER CHANNEL UNIQUE NAME",response);
return Map();