loading...
Cover image for How I’m learning about APIs by building a Slackbot

How I’m learning about APIs by building a Slackbot

totorosyd profile image Phoebe Updated on ・3 min read

Project Context

I have an HR background and with my experiences as an HR Partner in tech and banking industry, I see so much potential to improve the HR field with technology. Some areas to start with: communication, data management, data analytics, paperless process, automation workflow, knowledge management system and smart decision making using AI.

There have been so many great products to transform HR such as CultureAmp, Workday, Zendesk, Trello but I’ll say “We can do more!”.

I chose to build a Slackbot because a smart virtual assistant helps to improve productivity for both employees and HR team. For example, an employee is going to have a secondment wants to know about their journey (host-country’s culture, law, tax, company benefits, project details…). Traditionally, HR prepares lots of materials and training. But when employees want to check on certain things, either they have to read the materials again or ask HR again…and again. Both ways waste time and repeat communications.

Also, I finished my first project Eatthefrog, and it is a client-side web app. It runs on users’ browser and uses local storage to store tasks made by them, so it doesn’t “talk” to any server. With this Slackbot project (the bot’s name is heybot :), I will know how to answer those questions. Because I will:

  1. Be a SERVER receiving/responding requests from a user (via heybot on Slack) aka CLIENT.
  2. Be a CLIENT sending requests and receiving responses from a SERVER (BambooHR in this case).
  3. Practice working with APIs

So, what is heybot?
heybot is a Slackbot that integrates with BambooHR, and it assists employees (1) to know information about their time off, (2) to request time off on BambooHR from Slack and get request update.

Github repo

The Roadmap

This project is more complicated, so I broke it down to multiple versions. For each version (milestone), I have separated post to give you more insights about that version’s development story.

>> Part 1: Hello World version
>> Part 2: Hello Galaxy version (coming up next)
>> Part 3: Final version (coming up next)

Here is the bird’ s-eye view of the project.
Alt Text

Technology Choices

Python or Nodejs

While choosing Nodejs is a rational choice because I don’t have to face “environment change” issue and not to mention Slack API’s well-supported libraries and tools, I chose Python.

Inspired by Alexa, I want heybot to have conversations as natural as possible with a user, and it can “understand” the user’s intention/ request without fixed commands. Therefore, Python is a better choice. It has several popular and commonly used (Natural Language Processing) NLP libraries.

Flask vs Django

These are two popular frameworks for Python. According to some references #1, #2, #3, and the fact that I don’t need to build a web interface for heybot, Flask is a suitable framework. It provides enough functionalities for me to run heybot. Also, slackclient — Slack Developer Kit uses Flask.

Thanks for reading!
Phoebe

Discussion

pic
Editor guide
 

Just a heads up that there’s a built-in way for folks to link up posts in a series if you want to connect this to the other post you recently shared.

If you’re interested, you can learn more about how to use the series feature here.

Hope this helps and great post here! 😀

 

Oh1 I didnt know that :> Thanks.. I just read and made a series for this post

 

Good luck with your project, a big step in building a conversational API is to train the BOT that you have chosen to recognise words and phrases and map them to actions.

 

I totally agree. I think Python with its libraries for language processing could be useful!