Attendance integrations with webhooks

Send attendance alerts to Slack and Telegram

Updated · Author: Hadirly team

Slack and Telegram receive plain text. Hadirly sends the events that need attention, namely flagged attendance, correction requests, and offline kiosks, and turns each one into a single line of text. Neither service uses webhook signature headers, so security depends on keeping the Slack URL and the bot token secret.

Events sent

The Slack and Telegram presets send three event types by default: attendance.flagged, attendance.correction_requested, and kiosk.offline. Ordinary attendance that is not flagged is not sent to these channels, so the channel stays quiet and carries only items that need review.

Steps for Slack

  1. In Slack, open Apps, then Incoming Webhooks. Choose the channel that will receive messages.
  2. Copy the URL that begins with https://hooks.slack.com/services/.
  3. In Hadirly, create an endpoint with the Slack preset and paste that URL.
  4. Test the endpoint from Hadirly, then confirm the message appears in the right channel.

Slack accepts a JSON message that contains text. Hadirly sends that text as one short line.

Steps for Telegram

  1. Create a bot with @BotFather, then copy the bot token.
  2. Add the bot to the target group. A bot can only send to a chat where it is a member.
  3. Find the group’s chat_id, for example with the getUpdates method of the Bot API after the bot receives a message in the group.
  4. In Hadirly, create an endpoint with the Telegram preset. Paste the URL in the format below, replacing the token and chat_id with your own values:
TEKS
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=<CHAT_ID>

Hadirly rejects a Telegram endpoint that does not include a chat_id parameter.

Limits

  • Messages are one short line. They have no attachments, and the team cannot reply through this channel.
  • No signature can be checked. Anyone who has the Slack URL or the bot token can send a message to that channel.
  • If delivery fails, Hadirly retries up to six times. After that, the delivery is treated as a permanent failure.
  • If the last five deliveries to the same endpoint fail, that endpoint is disabled automatically.
  • Messages can include employee names and attendance details. Choose a channel whose members are allowed to see that data.

Checklist

  • The Slack channel or Telegram group is chosen for the people who will follow up.
  • The Incoming Webhook URL and the bot token are stored securely.
  • The Telegram bot is a member of the group, and its chat_id is correct.
  • A test message appears in the destination before the endpoint is used for real events.
  • An endpoint disabled after repeated failures is reviewed before it is turned on again.

Using several channels

One organisation can have up to 10 webhook endpoints. You can separate channels, for example one Slack channel for the operations team that follows up on flagged attendance, and one Telegram group for the managers of a branch office. Each endpoint has its own URL and token, so if one channel leaks, the others stay closed.

What each message contains

Each event is sent as one line of text that names its type and its main details, for example who and when. Text is cut at 4000 characters, which keeps it under the Telegram limit. Messages do not include face vectors, because an attendance record stores only a reference to the template, not the face data.

Events not sent

Ordinary attendance that is not flagged is not sent with these presets. You can change the list of events in the endpoint settings if you want other events. If every attendance record needs to reach a chat channel, choose the generic webhook, then filter on the receiver side.

When messages stop appearing

The delivery history in Hadirly shows the status of each message, the last HTTP code, and the error message. The failed status means Hadirly will retry on schedule. The dead status means the retries are used up. The last HTTP code usually shows the cause. A Slack Incoming Webhook URL that was deleted in Slack no longer receives messages, so the new URL must be entered in the endpoint in Hadirly. For Telegram, check the bot token and chat_id, and confirm that the bot is still a member of the group.

Sources

  • Slack, Sending messages using incoming webhooks.
  • Telegram Bot API, sendMessage method.

Try Hadirly for 14 days

The trial needs no payment up front. Register, verify your email, then install the apps.

Frequently asked questions

Can Slack confirm that a message came from Hadirly?

No. Slack does not send webhook-* headers, so the message signature cannot be checked. Keep the Incoming Webhook URL secret, and create a new URL in Slack if it leaks.

How long can a message to Telegram be?

Hadirly cuts the text at 4000 characters, which keeps it under the 4096-character limit that Telegram accepts.

Why can a Telegram bot not send to a group?

A bot can only send to a chat where it is a member. Add the bot to the group, then check that the chat_id in the URL is correct.