Integrate check in/check out notifications in Zoho Cliq with Zoho People

Integrate check in/check out notifications in Zoho Cliq with Zoho People

In a remote or hybrid work culture, one of the most significant pain points for teams is the constant uncertainty of colleague availability. Unanswered emails, missed Cliq pings, and irregular coordination lead to frustrating delays. To enhance overall productivity, let's integrate check-in/check-out notifications in Zoho Cliq with Zoho People.



This provides real-time alerts on your team's status so that everyone knows who's online, who's stepping away, and when to expect responses, empowering smoother collaboration without guesswork

Step 1: Enabling Zoho People integration (if available for you)

If you are a Zoho People user, you can enable the Zoho People integration in Cliq by following these steps:
  1. Navigate to https://cliq.zoho.com.
  2. Click on your profile in the top right corner, then select "Admin Panel."
  3. Go to the "Integrations" tab and enable the Zoho People integration.

Step 2 : Creating bot and generating webhook tokens

  1. Return to the Cliq homepage, click on your profile in the top-right corner, and select "Bots and Tools."
  2. To create a new bot, click on "Create Bot" located on the right side under the "Bots" section.
  3. Provide a name and description for the bot, and enable the channel configuration settings during the setup process.
  4. After creating the bot, copy the bot's incoming webhook URL and add authentication to it using a webhook token. (Create a webhook token and append it to the end of the URL.)


The Bot Incoming Webhook Endpoint facilitates real-time notifications. When connected to this endpoint, your Cliq component can promptly receive and process notifications from external sources.
Example: https://cliq.zoho.com/api/v2/bots/{$bot-unique-name}/incoming?zapikey={paste_webhook_token_here}

Step 3 : Setting up the workflow in Zoho People

  1. To connect Zoho People with your Cliq bot, start by navigating to Zoho People → Settings → Attendance → Automations → Workflow, and click Add Workflow.

  1. Select "Attendance" as the Form Name and set the Trigger Process to "Create" or "Edit". Next, move to the Action section and select Webhooks.
  2. In the webhook configuration, provide your webhook with a suitable name and paste the bot's incoming webhook URL (the one generated earlier) into the URL to Notify field.
  3. Set the method to POST, then configure the URL parameters as day, emailId, and name. Once you're done, save the webhook and the workflow.


Step 4: Setting up your bot to receive incoming webhooks

  1. Go back to Cliq and navigate to the bot's incoming webhook handler. To do this, click on the top right corner of your profile, then select "Bots and Tools."
  2. Under the "Bots" section, hover over the newly created bot and click "Edit Handlers." Find the incoming webhook handler and click "Edit Code."
  3. Now, copy and paste the code below, then click "Save."  
Pre-requisites:

Before beginning to script the code below, we must create a connection in Cliq with Zoho People. Once a connection is created and connected, you can use it in Deluge integration tasks and invoke URL scripts to access data from the required service.

Create a Zoho People default connection with any unique name with the scope - ZOHOPEOPLE.attendance.ALL  and replace the connection link name in code snippet line no:11.
ⓘ Document for reference : Connections in Cliq

To post an alert to the channel, you need the unique names of both the channel and the bot, as we are using zoho.cliq.postToChannelAsBot deluge task in the code below. Follow the steps to retrieve these names.

How to obtain or locate the channel unique name in Cliq?
      Navigate to the top right corner of the preferred channel and locate the three dots. Click it.
      In the menu that appears, select "Channel info" and a pop-up will open, displaying detailed channel information. Hover over the "Connectors" section and click it.
      Under "API Parameters," you will find the channel unique name.

How to obtain or locate the bot unique name in Cliq?
      Navigate to "Bots & Tools", and under the bots section, select the bot you prefer.
      Copy the API endpoint URL. The bot's unique name is located after "bots/" and before the next slash "/".

Example: URL: https://cliq.zoho.com/company/2345678/api/v2/bots/attendancetracker/message
The bot unique name in the above example is attendancetracker
  1. emailID = params.get("emailId");
  2. userName = params.get("name");
  3. day = params.get("day");
  4. bodyParameters = {"emailId":emailID};
  5. fetchUserAvailability = invokeurl
  6. [      
  7.       url :"https://people.zoho.com/api/attendance/getUserAvailability"
  8.       type :GET            
  9.       parameters:bodyParameters      
  10.       detailed:true      
  11.       connection:"<CONNECTION LINK NAME>"
  12. ];
  13. info fetchUserAvailability;
  14. if(fetchUserAvailability.get("responseCode") == 200)
  15. {
  16.       isUserAvailable = fetchUserAvailability.get("responseText").get("isUserAvailable");      
  17.       if(isUserAvailable == false)      
  18.       {      
  19.             status = "check-out";
  20.       }
  21.       else
  22.       {
  23.             status = "check-in";
  24.       }
  25.       //Post message in channel      
  26.       actionTime = zoho.currenttime;
  27.       actionTime = actionTime.toString("dd-MMM-yyyy hh:mm a");
  28.       postMessage = {"text":"_" + userName + "_  has *" + status + "* successfully! (" + actionTime + ")"};
  29.       info zoho.cliq.postToChannelAsBot(<CHANNEL UNIQUE NAME>, <BOT UNIQUE NAME>, postMessage);
  30. }
  31. else
  32. {
  33.       return {"text":"Something went wrong with the integration. Please check it!!!"};
  34. }
  35. return Map();

Everything is all set up! You'll receive a notification in the designated channel anytime there's a check-in or checkout.

Wrapping it up

Automating check-in and checkout alerts with Zoho People and Zoho Cliq stands as a visible proof of how small, targeted enhancements can yield substantial returns in team dynamics and output. Having transparency in employee availability not only reduces miscommunications but also cultivates a more responsive and unified workforce.

We're here to help, so don't hesitate to reach out to support@zohocliq.com with any questions or if you need assistance in crafting even more tailored workflows.