How I’m learning about APIs by building a Slackbot

totorosyd

Phoebe

Posted on September 21, 2020

How I’m learning about APIs by building a Slackbot

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

💖 💪 🙅 🚩
totorosyd
Phoebe

Posted on September 21, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related