# Python -------------------------------------------------------------------------------- title: "Introduction" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot." last_updated: "2026-03-18T07:41:08.679Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/introduction/" service: "All Services" related: - Project Directory Structure (/en/cli/v1/project-directory-structure/introduction/) - Python SDK (/en/sdk/python/v1/overview/) - Zoho Cliq (https://www.zoho.com/in/cliq/) - GitHub (https://github.com/) -------------------------------------------------------------------------------- # GitHub Bot ### Introduction This tutorial will help you build an extension on {{%link href="https://www.zoho.com/in/cliq/" %}}Zoho Cliq{{%/link%}} that will enable you to view the details of your {{%link href="https://github.com/" %}}GitHub{{%/link%}} repositories using a Cliq bot. The Cliq extension will bundle the following internal components: Commands, Function, and Bot. You can learn about these components from the {{%link href="https://www.zoho.com/cliq/help/platform/getting-started-with-cliq-platform.html" %}}Cliq help documentation{{%/link%}}. The Cliq chat bot will provide the following information along with appropriate links when you enter the right command in the chat: * List of all the repositories in the GitHub account * Details of the last ten commits made in a specific repository * Details of the last ten issues raised in a specific repository For example, when you enter the command to display the list of repositories in your Git account, the chat bot will display details as shown below. The bot will also send you an alert in the chat immediately after a commit is pushed to the Git repository, along with the commit details. This setup includes the following Catalyst component: 1. {{%link href="/en/serverless/getting-started/introduction/" %}}**Catalyst Serverless**{{%/link%}}: - {{%bold%}}{{%link href="/en/serverless/help/functions/integration-functions" %}}Integration Function{{%/link%}}:{{%/bold%}} The backend of this Cliq extension will be built using an Integration function in the {{%bold%}}Java{{%/bold%}} platform. This function will enable you to build and maintain the backend of the Cliq extension. We will associate this function with the extension while creating the extension on Cliq. After this integration is configured, the integration function will be invoked each time the Cliq bot is accessed. This setup will not include a Catalyst client component. We will code a few {{%link href="/en/serverless/help/functions/integration-functions/#cliq-integration-function-structure" %}}handlers{{%/link%}} in the Integration function that will handle specific events and actions. We will also use the Catalyst Command Line Interface (CLI) to build this application. You will be given the code for the files to be included in the Integration function in this tutorial. You will just have to copy the code given here and paste it into the appropriate files as directed. -------------------------------------------------------------------------------- title: "Prerequisites" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.679Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/prerequisites/" service: "All Services" related: - CLI Command Reference (/en/cli/v1/cli-command-reference/) - Install CLI (/en/getting-started/installing-catalyst-cli/) - Login CLI (/en/cli/v1/login/login-from-cli/) -------------------------------------------------------------------------------- # Prerequisites Before you begin building the application, you must have the following prerequisites installed on your system: 1. {{%bold%}}Catalyst CLI{{%/bold%}}<br /><br /> Catalyst CLI contains a host of tools that enable you to initialize, develop, test, and deploy the components of your application from your local machine. We will be working with Catalyst CLI in this tutorial. You must perform these actions: 1. {{%bold%}}Install Catalyst CLI:{{%/bold%}} Catalyst CLI is installed through NPM. You must therefore have NPM and Node.js installed on your system before you install the CLI. Refer to the {{%link href="/en/getting-started/installing-catalyst-cli" %}}**Install Catalyst CLI help page**{{%/link%}} for details on the pre-requisites and the steps to install it. 2. {{%bold%}}Login Catalyst CLI:{{%/bold%}} After you install Catalyst CLI, you must authenticate the CLI with your Catalyst account before using it. Refer to the {{%link href="/en/cli/v1/login/login-from-cli/" %}}**CLI Login help page**{{%/link%}} for the steps to login from Catalyst CLI and the various options available for it. 2. {{%bold%}}GitHub Account with Repositories{{%/bold%}}<br /><br /> You must have an account on {{%link href="https://github.com/" %}}GitHub{{%/link%}} that contains one or more repositories. Ensure that the repositories contain valid files. This will enable you to test the execution of the commands in the Cliq bot, and also verify if the bot sends you an alert when you push a commit to a repository. We will access GitHub to generate an access token and to configure a webhook with Cliq. 3. {{%bold%}}Zoho Cliq Account{{%/bold%}}<br /><br /> You must have a Zoho Cliq account set up. We will access the developer console of Zoho Cliq to create and configure the extension and associate it with the Catalyst Integration function. 4. **Install Python version 3.9** Before you begin developing your application logic in Python, please ensure you have the following package manager and programming environment installed on your local machine: * **{{%link href="https://pip.pypa.io/en/stable/installation/#" %}}Pip{{%/link%}}** - Python Package Manager * **{{%link href="https://www.python.org/" %}}Python version 3.9{{%/link%}}** You can install Python from their {{%link href="https://www.python.org/" %}}official website{{%/link%}} and the pip package manager will be auto-installed in your local system. Please make sure you install the pip package manually if you install Python from other sources. You can refer to {{%link href="https://pip.pypa.io/en/stable/installation/#" %}}this doc{{%/link%}} for installing pip. {{%note%}}{{%bold%}}Note:{{%/bold%}} If you have other versions of Python installed in your local machine (any version other than Python 3.9), then the execution of the Python functions in your directory will be skipped when the application is being {{%link href="/en/cli/v1/serve-resources/introduction" %}}served{{%/link%}} or {{%link href="/en/cli/v1/deploy-resources/introduction" %}}deployed{{%/link%}}.{{%/note%}} 5. **Any IDE tool for Python code development** You can use any IDE to work with the Integration function code. Some popular choices include Visual Studio Code, IntelliJ IDEA, Eclipse, and Sublime Text. Download and install an IDE of your choice in your system. {{%info image="/images/tutorials/todo-list/vscode.png"%}}If you are a Visual Studio Code IDE user, you can install the {{%bold%}}Catalyst Tools{{%/bold%}} extension, and use your IDE itself in place of the CLI. You can find more details about the Catalyst VS Code extension from this {{%link href="/en/catalyst-extensions/vs-code-extension/introduction/" %}}help section{{%/link%}}.{{%/info%}} -------------------------------------------------------------------------------- title: "Create a project" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.679Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/create-project/" service: "All Services" related: - Catalyst Projects (/en/getting-started/catalyst-projects) - Project Directory Structure (/en/cli/v1/project-directory-structure/introduction) -------------------------------------------------------------------------------- # Create a Project Let's {{%link href="/en/getting-started/catalyst-projects" %}}create a Catalyst project{{%/link%}} from the Catalyst console. 1. Log in to the {{%link href="https://console.catalyst.zoho.com/baas/index" %}}Catalyst console{{%/link%}} and click {{%bold%}}Create new Project{{%/bold%}}. 2. Enter the project's name as "{{%bold%}}GitHubBot{{%/bold%}}" in the pop-up window. 3. Click {{%bold%}}Create{{%/bold%}}. Your project will be created and opened. -------------------------------------------------------------------------------- title: "Generate a Personal Access Token on GitHub" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.679Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/generate-personal-access-token/" service: "All Services" related: - GitHub Integration (/en/devops/help/github-integration/introduction) -------------------------------------------------------------------------------- # Generate a Personal Access Token on GitHub Let us now generate a personal access token for the repositories in the Git account. A personal access token on GitHub functions like an OAuth access token and authenticates the access to the GitHub API. You can generate a personal access token on GitHub by implementing the below steps: 1. Login to your Git account. Click on your profile icon in the top right corner. Click on **Settings**. 2. Navigate to **Developer Settings**. 3. Click **Tokens(classic)** under the **Personal access tokens** menu, then click **Generate new token**. 4. Select **repo** as the scope. The token will be applicable for all the specified actions in your repositories. 5. Click **Generate new token**. The personal access token will be generated and displayed. GitHub will display the personal access token only once, so make sure that you copy the token and store it in a safe space. We will use this token in the Integration function’s code, which will enable Catalyst to fetch necessary information about the repositories from GitHub. -------------------------------------------------------------------------------- title: "Initialize the project" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.679Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/initialize-project/" service: "All Services" related: - Initialize CLI Resources (/en/cli/v1/initialize-resources/introduction) - Project Directory Structure (/en/cli/v1/project-directory-structure/introduction) -------------------------------------------------------------------------------- # Initialize the Project from the CLI You can now begin working on your Catalyst project from the CLI. The first step is to initialize the project in an empty directory. This will be the home directory of your project and all of the project files will be saved in it. You can learn more about this from the {{%link href="/en/cli/v1/project-directory-structure/introduction" %}}Project Directory Structure help page{{%/link%}}. You can learn about initializing a project in detail from the {{%link href="/en/cli/v1/cli-command-reference/" %}}CLI help documentation{{%/link%}}. 1. Create a folder for the project on your local machine and navigate to it from the terminal. 2. Initialize a project by executing the following command from that directory: {{%cli%}}catalyst init{{%/cli%}} 3. Select the preferred portal (or organization) by navigating using the arrow keys and press **Enter** to confirm. If you have no other organizations associated with the account, then the default one will be selected automatically. 4. Now, CLI will ask you to associate a Catalyst project with the directory. Associate it with the project that we created earlier from the console. Select **GitHubBot** from the list and press **Enter**. 5. Select **Functions** using the space bar. Press the **Enter** key to initialize. 6. The CLI will initiate the function setup. Select Integration as the function type. 7. Select {{%bold%}}Cliq{{%/bold%}} as the service and press Enter. 8. All Cliq handlers classes will be selected by default. Press {{%bold%}}Enter{{%/bold%}}. 9. Select **Python 3.9** as the function stack, and press **Enter**. 10. Press **Enter** to confirm the default package name as {{%badge%}}git_hub_bot_function{{%/badge%}} and the entry point as {{%badge%}}main.py{{%/badge%}}. The CLI will download and install the latest {{%link href="/en/sdk/python/v1/overview" %}}Catalyst Python SDK{{%/link%}} package. {{%note%}}{{%bold%}}Note:{{%/bold%}} Ensure that you enter the package name and file name exactly as instructed, because the application's code contains the same names.{{%/note%}}The functions directory is now created in the standard structure. Catalyst initialization is complete. Your project directory is now set up with the {{%link href="/en/cli/v1/project-directory-structure/functions-directory" %}}functions directory{{%/link%}} (CATALYST\_FUNCTIONS\_HOME) along with configuration files and dependencies. The project directory also contains the {{%badge%}}{{%link href="/en/cli/v1/project-directory-structure/catalyst-json" %}}catalyst.json{{%/link%}}{{%/badge%}}, a {{%link href="/en/cli/v1/project-directory-structure/functions-directory/#requirementstxt-file" %}}requirements.txt file{{%/link%}} and a hidden {{%badge%}}.catalystrc{{%/badge%}} file. This will be the final structure of your project directory. -------------------------------------------------------------------------------- title: "Configure the Integration function" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.689Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/configure-integration-function/" service: "All Services" related: - Integration Functions (/en/serverless/help/functions/integration-functions) -------------------------------------------------------------------------------- # Configure the Integration Function We will now configure the Integration function and add code to it. {{%note%}}{{%bold%}}Note:{{%/bold%}} We will need to code and deploy the function to the Catalyst remote console before configuring the extension on Cliq, because we have to associate the extension with an existing function from the Catalyst console.{{%/note%}} The {{%link href="/en/serverless/help/functions/integration-functions" %}}Integration function's directory{{%/link%}}{{%badge%}}functions/git_hub_bot_function{{%/badge%}} contains: * The {{%badge%}}main.py{{%/badge%}} main function file * Handler files * The {{%badge%}}catalyst-config.json{{%/badge%}} configuration file * {{%badge%}}requirements.txt{{%/badge%}} file to mention any external libraries that you might add Copy the code given below and paste it in the {{%badge%}}bot_handler.py{{%/badge%}}, {{%badge%}}command_handler.py{{%/badge%}} and {{%badge%}}functions_handler.py{{%/badge%}} in the {{%badge%}}functions/git_hub_bot_function{{%/badge%}} directory of your project, and save the file. You can use any IDE of your choice to work with the application’s files. We will also create a new file {{%badge%}}GithubConstants.py{{%/badge%}} in this directory and add code in it. {{%note%}}{{%bold%}}Note:{{%/bold%}} Please go through the code in this section to make sure you fully understand it. We will discuss the code at the end of this section.{{%/note%}} {{% panel_with_adjustment header="bot_handler.py" footer="button" class="language-java line-numbers" scroll="set-scroll" %}}import json from handlers.GithubConstants import GithubConstants import handlers.command_handler from zcatalyst_cliq.bot_handler import ( welcome_handler, message_handler, context_handler, mention_handler, menu_action_handler, webhook_handler, participation_handler, BotWelcomeHandlerRequest, BotMessageHandlerRequest, BotContextHandlerRequest, BotMentionHandlerRequest, BotMenuActionHandlerRequest, BotParticipationHandlerRequest, BotWebHookHandlerRequest, HandlerResponse ) from zcatalyst_sdk.catalyst_app import CatalystApp import logging @welcome_handler def welcome_handler_fn(req: BotWelcomeHandlerRequest, res: HandlerResponse, *args): res.text = f'hello {req.user.first_name}. Thank you for subscribing :smile:' return res @message_handler def msg_handler(req: BotMessageHandlerRequest, res: HandlerResponse, *args): msg = req.message text = '' if not msg: text = 'Please enable \'Message\' in bot settings' elif msg == "webhooktoken": btnobj = res.new_button() btnobj.type = "+" action = btnobj.new_action_object() action.type = "invoke.function" conform = action.new_confirm_object() conform.title = "Generate Webhooks for a GitLab Project" conform.description = "Connect to GitLab Projects from within Cliq" conform.input = "user_webhook_token" Actdata = action.new_action_data_obj() Actdata.name = "authenticate" action.data = Actdata action.confirm = conform btnobj.action = action btnobj.label = "Create Webhook" res.add_button(btnobj) text = "Click on the token generation button below!" else: text = "Oops! Sorry, I'm not programmed yet to do this :sad:" res.text = text return res @context_handler def ctx_handler(req: BotContextHandlerRequest, res: HandlerResponse, *args): app: CatalystApp = args[0] if req.context_id == 'personal_details': answer = req.answers name = answer.name.text dept = answer.dept.text text = f'Nice! I have collected your info: \n*Name*: {name} \n*Department*: {dept}' if answer.cache.text == 'YES': try: default_segment = app.cache().segment() default_segment.put('Name', name) default_segment.put('Department', dept) text += '\nThis data is now available in Catalyst Cache\'s default segment.' except Exception as e: logging.error(e) res.set_text(text) return res @mention_handler def mention_handler(req: BotMentionHandlerRequest, res: HandlerResponse, *args): text = f"Hey *{req.user.first_name}*, thanks for mentioning me here. I'm from Catalyst city" res.set_text(text) return res @menu_action_handler def action(req: BotMenuActionHandlerRequest, res: HandlerResponse, *args): text = '' res.bot = res.new_bot_details(GithubConstants.BOT_NAME,text) if req.action_name == "Repos": reposArray = handlers.command_handler.getRepos() if len(reposArray) == 0: text = "There aren't are repos created yet." else: Slide = res.new_slide() text = "Here's a list of the *repositories*" Slide.type = 'table' Slide.title = "Repo details" headers = [] headers.append('Name') headers.append('Private') headers.append('Open Issues') headers.append('Link') data = { 'headers':headers } rows = [] for repo in reposArray: row = { "Name": repo.get("name"), "Private": "Yes" if repo.get("private") else "No", "Open Issues": repo.get("open_issues_count"), "Link": f"[Click here]({repo.get('html_url')})" } rows.append(row) data['rows'] = rows json_data = json.dumps(data) Slide.data = json_data res.add_slides(Slide) else: text = 'Menu action triggered :fist:' res.set_text(text) return res @participation_handler def participation(req: BotParticipationHandlerRequest, res: HandlerResponse, *args): text = '' if req.operation == 'added': text = 'Hi. Thanks for adding me to the channel :smile:' elif req.operation == 'removed': text = 'Bye-Bye :bye-bye:' else: text = 'I\'m too a participant of this chat :wink:' res.set_text(text) return res @webhook_handler def webhook_fn(req: BotWebHookHandlerRequest, res: HandlerResponse, *args): req_body: dict = json.loads(req.body) commitJson = req_body["commits"][0] res.new_message() res.text="A new commit has been pushed!" res.bot = res.new_bot_details(GithubConstants.BOT_NAME,img='') commitMsg = res.new_slide() commitMsg.type = "text" commitMsg.title = "Commit message" commitMsg.data = commitJson["message"] res.add_slides(commitMsg) details = res.new_slide() details.type = "label" details.title = "Details" dataArray = [] commiter = {} commiter['Committer'] = commitJson["author"]["username"] dataArray.append(commiter) repoName = {} repoName['Repo Name'] = req_body["repository"]["name"] dataArray.append(repoName) timestamp = {} timestamp['Timestamp'] = commitJson["timestamp"] dataArray.append(timestamp) compare = {} compare["Compare"] = f"[Click here]({req_body['compare']})" dataArray.append(compare) details.data = json.dumps(dataArray) res.add_slides(details) return res {{% /panel_with_adjustment %}} {{% panel_with_adjustment header="command_handler.py" footer="button" class="language-java line-numbers" scroll="set-scroll" %}} from typing import List import json from handlers.GithubConstants import GithubConstants import zcatalyst_cliq.command_handler as command import requests from zcatalyst_cliq.command_handler import ( execution_handler, suggestion_handler, CommandHandlerRequest, CommandSuggestion, HandlerResponse ) @execution_handler def executor(req: CommandHandlerRequest, res: HandlerResponse, *args): text = '' res.bot = res.new_bot_details(GithubConstants.BOT_NAME,img=text) cmd = req.name if cmd == 'commits': suggestions = req.selections if not suggestions: text = 'Please select a repo from the suggestions.' else: repoName = suggestions[0].title commitsArray = getCommits(repoName) if len(commitsArray) == 0: text = "There aren't any commits made yet." else: Slide = res.new_slide() text = f"Here's a list of the latest {GithubConstants.PER_PAGE} commits made to the repository *{repoName}*." Slide.type = "table" Slide.title = "Commit details" headers = [] headers.append('Date') headers.append('Commit message') headers.append('Committed by') headers.append('Link') data = { 'headers':headers } rows = [] for obj in commitsArray: commit = obj.get("commit") author = commit.get("author") row = { "Date": author.get("date"), "Commit message": commit.get("message"), "Committed by": author.get("name"), "Link": f"[Click here]({obj.get('html_url')})" } rows.append(row) data["rows"] = rows json_data = json.dumps(data) Slide.data = json_data res.add_slides(Slide) elif cmd == 'issues': suggestions = req.selections if not suggestions: text = 'Please select a repo from the suggestions.' else: repoName = suggestions[0].title IssuesArray = getIssues(repoName) if len(IssuesArray) == 0: text = "There aren't any issues made yet." else: Slide = res.new_slide() text = f"Here's a list of the latest {GithubConstants.PER_PAGE} issues raised to the repository *{repoName}*." Slide.type = "table" Slide.title = "Issue details" headers = [] headers.append('Created At') headers.append('Title') headers.append('Created By') headers.append('Link') data = { 'headers':headers } rows = [] for issueObj in IssuesArray: row = { "Created At": issueObj.get("created_at"), "Title": issueObj.get("title"), "Created By": issueObj.get("user").get("login"), "Link": f"[Click here]({issueObj.get('html_url')})" } rows.append(row) data["rows"] = rows json_data = json.dumps(data) Slide.data = json_data res.add_slides(Slide) else: text = "Slash command executed" res.text = text return res def getCommits(name): req = f"https://api.github.com/repos/{getUsername()}/{name}/commits?per_page={GithubConstants.PER_PAGE}" headers = {} headers['Authorization'] = f'Token {GithubConstants.PERSONAL_ACCESS_TOKEN}' response = requests.get(url=req,headers=headers) data = response.json() if response.status_code == 200: return data else: return [] def getUsername(): req = "https://api.github.com/user" headers = {} headers['Authorization'] = f'Token {GithubConstants.PERSONAL_ACCESS_TOKEN}' response = requests.get(url=req,headers=headers) data = response.json() return data["login"] def getRepos(): req = "https://api.github.com/user/repos" headers = {} headers['Authorization'] = f'Token {GithubConstants.PERSONAL_ACCESS_TOKEN}' response = requests.get(url=req,headers=headers) data = response.json() return data def getIssues(repoName): req = f"https://api.github.com/repos/{getUsername()}/{repoName}/issues?per_page={GithubConstants.PER_PAGE}" headers = {} headers['Authorization'] = f'Token {GithubConstants.PERSONAL_ACCESS_TOKEN}' response = requests.get(url=req,headers=headers) data = response.json() return (data) @suggestion_handler def suggester(req: CommandHandlerRequest, res: List[CommandSuggestion], *args): suggestionList = [] reposArray = getRepos() repos = reposArray repoNames = [] for repo in repos: name = repo["name"] repoNames.append(name) if req.name == "commits" or req.name == "issues": for name in repoNames: sugg= CommandSuggestion(title=name) suggestionList.append(sugg) return suggestionList {{% /panel_with_adjustment %}} {{% panel_with_adjustment header="function_handler.py" footer="button" class="language-java line-numbers" scroll="set-scroll" %}} from datetime import datetime from zcatalyst_cliq import function_handler from zcatalyst_cliq.function_handler import ( button_function_handler, form_submit_handler, form_change_handler, form_dynamic_field_handler, widget_button_handler, ButtonFunctionRequest, FormFunctionRequest, WidgetFunctionRequest, HandlerResponse, FormChangeResponse, FormDynamicFieldResponse, WidgetResponse ) @button_function_handler def button_fn_handler(req: ButtonFunctionRequest, res: HandlerResponse, *args): text = '' if req.name == 'authenticate': text = req.arguments.input else: text = "Button function executed" res.text = text return res @form_submit_handler def form_submit(req: FormFunctionRequest, res: HandlerResponse, *args): return {} @form_change_handler def change_form(req: FormFunctionRequest, res: FormChangeResponse, *args): return res @form_dynamic_field_handler def handle_dynamic_field(req: FormFunctionRequest, res: FormDynamicFieldResponse, *args): return res @widget_button_handler def widget_button(req: WidgetFunctionRequest, res: WidgetResponse, *args): return {} def get_button_section(): widget_response = function_handler.new_widget_response() button_section = widget_response.new_widget_section() return button_section {{% /panel_with_adjustment %}} Next, create a new Python file in the {{%badge%}}handlers{{%/badge%}} folder and name it {{%badge%}}GithubConstants.py {{%/badge%}}. Add the code given below to the file. {{% panel_with_adjustment header="GithubConstants.py" footer="button" class="language-python line-numbers" scroll="set-scroll" %}}import zcatalyst_cliq._handler class GithubConstants: PERSONAL_ACCESS_TOKEN = '{{Enter your Git personal access token here}}' PER_PAGE = 10 BOT_NAME = "GitHubBot" {{% /panel_with_adjustment %}} {{%note%}}{{%bold%}}Note:{{%/bold%}} After you copy and paste this code, {{%bold%}}paste the personal access token that you obtained from GitHub{{%/bold%}} in Step 2 on line 5 in this code. {{%/note%}} The functions directory is now configured. Let's quickly go over the code of the handler classes.We will discuss the components specified here in detail while {{%link href="/en/tutorials/githubbot/java/create-extension-on-cliq" %}}configuring the extension{{%/link%}}. * The {{%badge%}}{{%bold%}}bot_handler.py{{%/bold%}}{{%/badge%}} module contains the business logic of the GitHub bot component that we will configure in the Cliq extension. After you enable the chat bot, you can generate a webhook token to authenticate the connection to GitHub, list the details of your Git repositories, and obtain the details of the latest commits and issues in a repository. These actions are defined in this class. * The {{%badge%}}{{%bold%}}command_handler.py{{%/bold%}}{{%/badge%}} module handles the actions to be performed for the issues and commits commands. It also defines the suggestion handler that lists the repos of the Git account. The user must select a repo from the suggestion after entering the command, to execute the command for. {{%badge%}}command_handler.py{{%/badge%}} also defines the APIs for fetching other information from the Git account. * The {{%badge%}}{{%bold%}}function_handler.py{{%/bold%}}{{%/badge%}} module contains the business logic of the button function that authenticates the webhook token for GitHub. * The {{%badge%}}{{%bold%}}GithubConstants.py{{%/bold%}}{{%/badge%}} class module stores the constant values of the function, such as the personal access token and the bot name. -------------------------------------------------------------------------------- title: "Deploy the function" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.689Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/deploy-function/" service: "All Services" related: - Deploy Resources (/en/cli/v1/deploy-resources/introduction) - Integration Functions (/en/serverless/help/functions/integration-functions) -------------------------------------------------------------------------------- # Deploy the Function Let's deploy the function to make it available in the Catalyst remote console. We will need to select it while creating the extension on Cliq. To {{%link href="/en/cli/v1/deploy-resources/introduction" %}}deploy your Catalyst project from the CLI{{%/link%}}, run the following command in your terminal from your project directory: {{%cli%}}catalyst deploy{{%/cli%}} -------------------------------------------------------------------------------- title: "Create an extension on Cliq" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.689Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/create-extension-on-cliq/" service: "All Services" related: - Integration Functions (/en/serverless/help/functions/integration-functions) -------------------------------------------------------------------------------- # Create an Extension on Cliq You can now configure the extension in Cliq. As mentioned in the introduction, this Cliq extension will bundle all the development components that we will require for this setup. You can learn about Cliq extensions in detail from the {{%link href="https://www.zoho.com/cliq/help/platform/build-cliq-extensions.html" %}}Cliq help documentation{{%/link%}}. We will add the following Cliq components to be bundled in the extension: * {{%bold%}}Command for issues:{{%/bold%}} A command handled by the {{%badge%}}command_handler.py{{%/badge%}} class that fetches the last ten issues raised in a specific repository. * {{%bold%}}Command for commits:{{%/bold%}} A command handled by the {{%badge%}}command_handler.py{{%/badge%}} class that fetches the last ten commits made in a specific repository. * {{%bold%}}Button function to authenticate the webhook token:{{%/bold%}} A function handled by the {{%badge%}}function_handler.py{{%/badge%}} class that is executed when a button is clicked in the chat bot. This function authenticates the webhook token for GitHub. * {{%bold%}}GitHub bot:{{%/bold%}} A chat bot handled by the {{%badge%}}bot_handler.py{{%/badge%}} class that enables you to execute these commands. The bot also includes a menu action that lists your existing repositories, and enables you to select a repo to execute a command for. Please make sure to follow the below steps to configure the Cliq extension: 1. Log in to your Cliq account and open the {{%link href="https://cliq.zoho.com/developer" %}}Cliq developer console{{%/link%}}. Click **Create Extension**. 2. Enter the name of the extension as "{{%bold%}}GitHubExt{{%/bold%}}" and enter a description for it as shown in the screenshot below. Select the execution type as {{%bold%}}Catalyst Function{{%/bold%}}. Choose your organization in which you have created the project in {{%link href="/en/tutorials/githubbot/python/create-project" %}}this step{{%/link%}}. Select the project **GitHubBot** and the function {{%badge%}}git_hub_bot_function{{%/badge%}} from the dropdown list. This allows the extension to invoke the function whenever any of the components in the extension are accessed. We can now proceed to add components that we will require for this extension. Select the Catalyst project {{%bold%}}GitHubBot{{%/bold%}} that we created for this tutorial and the {{%bold%}}GithubExtension{{%/bold%}} function from the dropdown lists. This lets the extension invoke the function whenever any of the components in the extension are accessed. We can now add the components that we will require for this extension. 3. Click {{%bold%}}Add components{{%/bold%}}, then click {{%bold%}}Command{{%/bold%}}. 4. Enter the command's name as "issues". Provide a hint for the command as shown in the description below. In the **Command Handlers** section, choose **Attachments**, **Chat**, **Location** and **User** for the **Execution Handler**. Enable the **Suggestion Handler** and allow access for **Chat**, **Location** and **User**. Configure the command to execute on selecting only one suggestion. Click **Add**. 5. Similarly, click the {{%bold%}}Add components{{%/bold%}} button in the extension configuration again, then click {{%bold%}}Command{{%/bold%}}. Provide the name of the command as **"commits"**. Make sure to implement the same configuration as that of the issues command here as well. Click **Add**. 6. Next, we will add a **Function** component. Provide the name of the function as **“authenticate”**. Give a description for the function as shown in the screenshot below. Select the **Function Type** as **Button** and click **Add**. 7. Finally, we will add a {{%bold%}}Bot component{{%/bold%}} and configure the name as **"GitHub Bot"**. Give a description as shown in the screenshot below. Enable **Channel Participation** and select both **Listen to messages** and **Send messages**. Enable all the handlers, and select all the enabled checkboxes. This will enable the bot to acknowledge messages in the chat and the webhook requests received from GitHub. You must also add a bot menu action **Repos** that lists and select all the checkboxes. Now, we have added all the required components for the Cliq Extension. {{%note%}}{{%bold%}}Note:{{%/bold%}} Ensure that you have given the same component names as specified, because we have configured the same names in the function code.{{%/note%}} 8. Click **Create Extension** in the extension configuration page and the created extension will be listed in the Cliq developer console under the **Cliq Extensions** section. {{%note%}}{{%bold%}}Note:{{%/bold%}} Since we have hardcoded the Personal Access token to access the GitHub API in the {{%badge%}}GithubConstants.py{{%/badge%}} class, it is not advisable to publish this extension, as the code contains a confidential token.{{%/note%}} The Cliq bot will now be available in your Cliq account. The {{%badge%}}issues{{%/badge%}} and {{%badge%}}commits{{%/badge%}} commands, along with the {{%badge%}}Repos{{%/badge%}} menu action will work in the bot. Before you test these commands, you must also enable alerts to be received automatically whenever a commit is pushed to one of the repositories in the GitHub account using a webhook. -------------------------------------------------------------------------------- title: "Configure a bot" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot" last_updated: "2026-03-18T07:41:08.715Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/configure-bot/" service: "All Services" related: - Integration Functions (/en/serverless/help/functions/integration-functions) -------------------------------------------------------------------------------- # Configure the Bot as an Incoming Webhook Notifier Next, let's configure the bot as an incoming webhook notifier, that performs actions when the webhook URL is invoked on GitHub. You can do this in the following way: 1. Generate a webhook token on the Cliq bot 2. Obtain the App key of your extension 3. Obtain the webhook handler URL of your extension 4. Create a webhook on GitHub and configure these values We will discuss these actions in detail one after the other. This webhook gets triggered whenever a commit is pushed to one of the repositories on your Git account. When that event occurs, GitHub makes an HTTP request to the URL webhook handler URL with the credentials that we configure. It will pass the details of that push event to Cliq, and the Cliq bot will notify you of it and display the details. ### Generate a WebHook Token You can generate a webhook token on Cliq as described below. The webhook token is authenticated by the authenticate button function that we configured in the previous step. 1. Search for the GitHub bot in your Cliq account. Select the bot and click {{%bold%}}Continue{{%/bold%}}. 2. Provide permission for the bot to access your account details. The chat will be activated. 3. Type **"webhooktoken"** in the chat and press {{%bold%}}Enter{{%/bold%}}. Then click **Create Webhook**. 4. Click {{%bold%}}Create Webhook{{%/bold%}}. In the pop up that appears, we will need to enter the webhook token of the bot. To fetch the webhook token, click on the **Profile** icon in the top right corner of the page. Click **Bots & Tools**. Click on **Webhook Tokens** in the Integrations menu. Click **Generate New Token** and copy the generated token. Paste the token value in the pop-up and click **Submit**. ### Obtain the App Key You can obtain the App Key of the extension in the following way: 1. Click on the {{%bold%}}GitHubExt{{%/bold%}} extension from the extensions page in the {{%link href="https://cliq.zoho.com/developer" %}}Cliq developer console{{%/link%}}, then navigate to the {{%bold%}}Connectors{{%/bold%}} section. 2. Copy the Sandbox App Key of your extension. This key will be the value of the {{%badge%}}{{%bold%}}appkey{{%/bold%}}{{%/badge%}} parameter in the URL that we will configure on GitHub. ### Obtain the Webhook Handler URL You can obtain the Webhook Handler URL of the extension in the following way: 1. Navigate back to your Cliq account and click on your profile picture. Click on {{%bold%}}Bots & Tools{{%/bold%}} in the menu section. 2. Click on the {{%bold%}}GitHub Bot{{%/bold%}} from your bots list. This will open a side panel. Copy the URL displayed under _Incoming WebHook Endpoint_. This will be the baseURL that we will configure on GitHub. ### Create a Webhook on GitHub The complete URL to configure on GitHub is: {{%bold%}}_baseURL_?{{%badge%}}appkey{{%/badge%}}\={{_appkey_}}&{{%badge%}}zapikey{{%/badge%}}\={{_zapikey_}}{{%/bold%}} where _baseURL_ is the webhook handler URL, {{%badge%}}appkey{{%/badge%}} is the sandbox App Key of your extension, and {{%badge%}}zapikey{{%/badge%}} is the webhook token generated on Cliq. For example: {{%bold%}}https:<span></span>//cliq.zoho.com/company/org_id/api/v2/githubbot/incoming?appkey={{_appkey_}}&zapikey={{_zapikey_}}{{%/bold%}} Let's now add this URL on GitHub in the following way: 1. Open your {{%link href="https://github.com/" %}}GitHub{{%/link%}} account and navigate to any one of your repositories. 2. Open your {{%bold%}}repository's settings{{%/bold%}}, then click {{%bold%}}Webhooks -> Add webhook{{%/bold%}}. 3. Enter the URL in the format specified above, substituting the values of {{%badge%}}appkey{{%/badge%}} and {{%badge%}}zapikey{{%/badge%}}. Configure the webhook as shown below. You can select the events that you would like to be notified about. 4. Click {{%bold%}}Add webhook{{%/bold%}}. This webhook will now enable alerts for the configured events in your repository. -------------------------------------------------------------------------------- title: "Test the GitHub bot" description: "Build an extension on Zoho Cliq using Catalyst Integration Functions, that enables you to access and work with your GitHub repositories using a Cliq bot." last_updated: "2026-03-18T07:41:08.716Z" source: "https://docs.catalyst.zoho.com/en/tutorials/githubbot/python/test-github-bot/" service: "All Services" related: - Integration Functions (/en/serverless/help/functions/integration-functions) -------------------------------------------------------------------------------- # Test the GitHub Bot We can now test the commands and functioning of the GitHub bot. Open your Cliq account and open {{%bold%}}GitHub Bot{{%/bold%}}. Let's first test the **issues** command. All Cliq commands must be entered with a preceding '/' backslash. Type **"/issues"** in the bot's chat. This will trigger the {{%badge%}}git_hub_bot_function{{%/badge%}} and enable the command handler to fetch the repositories in your Git account. Your repositories will be displayed in the chat. You can select a repository using the arrow buttons, then press {{%bold%}}Enter{{%/bold%}}. This will display the details of the last ten issues raised to that repository, if any. You can view any of these issues on GitHub by clicking on its link. Next, type **"/commits"** in the chat and select one of the repositories from the list. This will display the details of the last ten commits pushed to that repository, if any. You can click {{%bold%}}Post here{{%/bold%}} to post the details as a message by the bot, and {{%bold%}}Close{{%/bold%}} to remove the embedded view. You can also test the bot menu action that you configured for the GitHub bot. Click on **Repos** menu that is displayed below the chat window. This will list the details of all the repositories in the GitHub account. You can verify if the Cliq bot alerts you whenever a commit is pushed in the repository that you configured the webhook for. Make a commit in that repository. The Cliq bot will send you an alert with the commit details and a link to access that repository. If all actions work fine, the GitHub bot is configured properly.