How I’m learning about APIs by building a Slackbot

Phoebe Phuong Nguyen
3 min readSep 20, 2020

Project Context

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

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

Also, I finished my first project Eatthefrog, and it is a client-side web app. It runs on users’ browsers 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 to 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 updates.

Github repo

The Roadmap

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

>> Part 1: Hello World version

>> Part 2: Hello Galaxy version

>> Part 3: Final version

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

sequence diagram and project roadmap
Sequence Diagram and Roadmap

Technology Choices

Python or Nodejs

While choosing Nodejs is a rational choice because I don’t have to face “environment change” issues, 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.

Take-aways

A fancy tool is not always the optimal choice

Django might make my project look fancier, but a tool must serve the work purpose and scope. So as long as the tool gives the functionalities we want, it doesn’t have to be fancy.

Thanks for reading!

Phoebe

--

--

Phoebe Phuong Nguyen

Software Engineer with strong HRIS expertise. love surfing and playing beach volleyball when I don’t code!