Zendesk Discord Chatbot using Webhooks
Zendesk Discord Chatbot using Webhooks
Two years ago, the support team at Yaksa (before Verndale had purchased the company) used a Microsoft Teams bot application that was integrated with our Zendesk ticketing platform. The chatbot messages you in realtime anytime your ticket is updated. Although we do get emails in near real-time, I always find the frequency of the emails to be too noisy and Outlook/Windows would not properly send notifications when a new email would come in. I really appreciated the Zendesk Teams bot, as the instant notifications improved my response time and productivity.
In the last year, (although unrelated) around the time our company got bought out by Verndale, the Teams bot began misbehaving. It would start double messaging and phantom messaging the team about tickets that had not been updated at all. It also sent messages much later than they were updated, defeating the original purpose of the bot. It had gotten so bad that everyone on the support team muted the Zendesk bot and completely stopped using it. Later that year, we eventually migrated our messaging platform from Teams to Slack and the Zendesk bot had become a memory of the past.
6 months ago, there was an in house AI hackathon that was hosted by Verndale. The support team decided to create a bot that integrated with Zendesk using webhooks. Ultimately, we didn't spend enough time working on the hackathon, which led to a presentation that was less than stellar. It did, however, give us access to various Zendesk APIs and webhooks. Funnily enough, in the back of my mind, I did consider the possibility to create my own bot that used the webhooks, but the hackathon was over and our access as well as any enabled webhooks would soon be disabled... Or so I thought.
Just last month, I began playing with Docker and one of the new applications that I discovered was Uptime Kuma. It is a site monitoring tool that can integrate into various chat platforms notifying you when a site becomes unavailable. This was quite useful for me to check the uptime of my Plex and Immich sites. Naturally, I integrated it with Discord, but it also got me thinking again about the possibility of integrating Zendesk with Discord. I checked if the webhooks were still active, and to my excitement, it was!
I immediately knew that I wanted to recreate the chatbot but I also had to ensure that the uptime would be reasonable. I immediately thought of just hosting the bot using Vercel, because of the generous free tier and ease of integrating with Next.js, but I quickly became afraid that it would be violating their terms of service. This bot would technically no longer qualify as a "hobby" project, as the bot is technically an internal tool for "commercial use". What I ended up going with was creating a website using Pocketpages on Pockethost. In the end, my solution was quite hacky, as the Pocketpages framework is not very well known, but the documentation was "good enough". The most important part was that it was free and the uptime was not handled by myself.
I won't really bore you with the details, but effectively, the webhook that is sent by Zendesk includes all the ticket information such as Ticket No, Assignee Id, Actor Id, Message, Ticket Type, and Custom statuses. With this information, I am able to identify who updated the ticket, who the ticket is assigned to, if the ticket is about to breach, the ticket number, and the client organization. Using that information, I am able to send the ticket to the appropriate Discord user along with essential information.
Now, I am able to relax and not worry about whether or not I have missed an update in any of the tickets assigned to me.