Roger Swannell

Category: Interniser

Customer service chatbot using Freshdesk API

Having built a chatbot that uses the eBay API, and with the idea of a customer service chatbot floating around, I decided to see if I could build a chatbot that uses the Freshdesk API to pull content from the Help Articles into a chat flow to answer queries from customers.

The bot introduces itself as any good bot should, and then asks the customer how it can help.

The buttons that the bot displays are dynamically populated by querying the results from the Freshdesk API to find out what top level categories are available in the Help Articles section on Freshdesk.

When the customer selects the appropriate category the bot dynamically creates buttons again from what is returned by querying the sub-categories in Freshdesk.

And when the customer selects a button the bot will calls the content of the Help Article and displays it in the flow.

The bot then checks if that Help Article is what the customer is looking for. If the customer selects Yes the bot tells the customer that it’s glad and ends the conversation. If the customer selects No, the bot allows the customer to contact a human by raising a ticket in Freshdesk.

The bot is very simple, partly because there aren’t very many Help Articles to pull from, but it demonstrates that using the Freshdesk API to populate the buttons on the fly can work and means that the content only needs to be maintained in Freshdesk and not within the chatbot.

Thinking about a Bucks Mind Guide Chatbot

Buckinghamshire Mind is a local mental health charity that supports people across Buckinghamshire. Last year they created the Bucks Mind Guide, a fantastic resource with helpful links to all kinds of services that can support people with mental health problems.

Bucks Mind Guide Website

So, in my bid to make a chatbot for everything, I started thinking about how I could take the masses of information in the guide and convert it into a conversational experience and build a chatbot. My first thought was that because there was so many options for users to ask about and the bot to provide answers for, it couldn’t use button like most of my other bots and would need to recognise keywords and respond accordingly. I considered using Dialogflow (I used used it a while ago when it was API.AI) to handle picking up the keywords, and may still do so later, but to keep it simple I started with using Labels to pick up the keyword entered by the user and jump to the section of the flow that could provide an answer related to that keyword.

Bucks Mind Guide Chatbot

Now, I just need to add to the number of keywords the bot can respond to, and make the messages more friendly.

EbayBot Part 1: Getting search results

The British Heart Foundation eBay store is probably one of the most successful charity stores on eBay. It has thousands of listings of all kinds of interesting and unique items that have been donated to the BHF to raise money for life saving research into all kinds of heart conditions.


British Heart Foundation eBay Store

I wanted to build a Chatbot that could search the listings of a specific eBay store and return results based on a user inputted search term. The idea was simple; the bot asks the user what they are looking for, the user enters their search term, e.g. “camera”, and the bot returns all the listings on the BHF eBay store that match.


I broke the flow into three parts: Getting the search results, displaying the search results, and filtering the search results.


This was my first bot using an API to pull data from the web so I had a lot to learn about how to get the search results from eBay. And I didn’t really know how I was going to get the results to display in a chatbot, which listing info was essential and which I could do without, but I knew that with thousands of products on the BHF eBay Store at any one time, the third stage of filtering the listings was going to be essential for making the chatbot useful.


Getting the search results

I started by creating a developer account with ebay to get access to this suite of API’s.


Ebay has an API called ‘findItemsIneBayStores’ but I couldn’t get it to return results for the BHF store. A quick bit of Goggling showed that this API was known to be unreliable so I moved on to using the ‘findItemsAdvanced’ API.


This gave me greater control over the returning results which meant that I could pull results only for the correct store and get the elements I wanted to display to the user: Listing name, image, url on eBay. This API also allowed me to limit the number of returning results and display them in order of finished soonest first. Doing this would reduce the amount of filtering the user would have to do to find an item they were interested in.


So, when the flow was the started, EbayBot asks the user what they would like to search for. The users types ‘camera’

eBay Bot user search camera

The bot then uses the eBay API to pull back data for active listings in the BHF store that contain the keyword ‘camera’.


Getting reliable search results returned in JSON format was great. Now I had all the data I needed.


The next steps

The next step will be to figure the best way to display these results to the user in the chat flow. I think it’ll probably be a set of image cards that show the listing title, an image of the product, perhaps the current price, and either a link to the listing on eBay or a button to look at a single listing in more detail. I think this user experience decision comes down to whether users are likely to be able to choose the listing they are looking for with the first set of results, which means sending them out of the flow to eBay would be fine, or if the first set of results doesn’t give them enough info to choose, in which case i wouldn’t want them bouncing back and forth between the bot and the eBay website so I’ll make it so they can go into expanded information for each listing. I might also have a look at whether there is a way to identify if they have the eBay app installed on their phone and if so open that rather than link to the website.

Interniser Version 2: Productivity 

With version 1 of my Interniser bot deployed to live for the ATBA-UK, I decided to build version 2 to answer my questions about using bots to help with productivity. 

For my MVP Productivity Bot I integrated with ToDoIst, Trello and Freshdesk. I use ToDoIst for task management, Trello for managing the progress and status of projects, and Freshdesk for customer service enquiries so being able to interact with them over Messenger showed me that a bot could be used as a single interface for all of these different systems. 

As this was a quick MVP I only built the integration to add to these systems, but the API between the chatbot and ToDoIst, Trello and Freshdesk allows for much more control. 

The next bot I’m thinking of (Version 3) will be a helper bot and test how bots can be a bit more human and have a long term conversation. 

What next for Interniser

The bot that I built on Interniser has been moved to its permanent home with ATBA-UK. It has some additional functionality such as being able to send a message to a human and we still have to name it (Atbamus Prime is my favourite), but moving it frees up Interniser for the next project.

interniser atbamus prime

I haven’t quite decided what the next project should be but I’m interested in two areas; how bots can provide information to a user, and how bots collect information from a user. The bot I built for ATBA-UK did a bit of both but I’d like to take it further.

Providing information is probably the more challenging of the two because I can only guess at what the user is looking for and if I get it wrong then the user has a poor experience and goes away unsatisfied.

Collecting information is a bit easier as it starts with me deciding what questions to ask, but motivating users to bother answering is another matter.

I did think about building a bot that provides the info on my website but a) no one would be interested, and b) there really isn’t anywhere to go from there.

I guess I’ll keep looking for ideas.

Using Interniser bot for UK Mountainboard Championship Registrations

I built the first bot for interniser to handle competitor registrations for the UK Mountainboard Championship.

I had a few initial requirements. I knew I wanted it to use the name of the person it’s speaking to, and to offer some info about the comp if the person chatting didn’t want to enter. I figured out the basic logic of how registration should work (discipline first, then category), and this was enough to build a minimum viable product to prove that a bot could handle registrations for a mountainboard competition.

Interniser Bot for UK Mountainboard Championship Registration

The bot is triggered by the person initiating the conversation (as per Facebook’s terms and conditions) and starts by offering two options: Info or Register. Clicking Info triggers the bot to send a single message with when and where the competition is, which over time could be expanded to include more information, a link, and other more complicated options. Clicking Register triggers the bot to ask a question and then respond based on the answer. Once the competitor had been through all the registration options the bot tells them that they are registered and then posts the responses into a Google Sheet, which we can use to know which competitions each person intends to enter.

Although the bot works pretty well for an MVP, it doesn’t solve the real problem of handling competitor registrations on the day of the competition, and knowing what a competitor intended to do doesn’t tell you what they actually want to do on the day, but maybe that can be part of a later iteration.

Relaunching interniser

As I’ve thought more about bots and what they could be used for (pre-diagnosis for the 111 service and getting info about places to visit) I decided to relaunch interniser as a side project to do all my bot projects under. It seems more appropriate than RogSwaBot which would be fine for more personal stuff and which I may still work on. 

I built a quick responsive webpage in html 5 and will get it uploaded once I’ve set up the domain. And I set up the Facebook page so I can connect the webpage to the messenger service. The next stage will be to start building an MVP bot using a simple keyword response system before I move on to learning Python and how to integrate a more complex AI system. 

I don’t know where interniser might go but it should be an interesting side project. 


One of the first websites I ever built was called interniser, the internet organiser. It was a hand-coded, manually sorted list of links on a page. The idea was for it to be a bookmarking service with each customer having their own page/microsite. I wonder what it would have developed into if I’d carried on with it? I wonder what it would look like today?

Maybe it would look something like this

Copyright © 2019 Roger Swannell

Up ↑