# Librarian: Building a Serverless Slack App Using Postman and Airtable

At Postman, some of us are avid readers, and we have a nice little library at our office where we share our books. Even though our library is small, finding a book is tedious because we have to manually search for one. We don’t keep track of books that are borrowed. It’s happened before that I want to read a book, but it was borrowed by someone, and I end up ordering a new one.[![](https://blog.postman.com/wp-content/uploads/2017/12/image3-1.jpg)](https://blog.postman.com/wp-content/uploads/2017/12/image3-1.jpg) As a UX designer at Postman, I was familiar with [Airtable](https://airtable.com/) from their nice graphical interface, making databases intuitive and super easy to work with. I suspected there was a way to use Postman and Airtable together to solve our issue of keeping track of the books in our library. ## The Librarian

 Enter the **Librarian** - a serverless slack app using Postman and Airtable to check the availability of a book in the office library. In this case, we are searching for a book using a Slack app, and also storing the books that we have in the Postman office using Airtable as a database. You can search for your book by typing `/bookbug [book-name]` in Slack. No switching applications or learning a new UI! ? [![](https://blog.postman.com/wp-content/uploads/2017/12/image4-2.png)](https://blog.postman.com/wp-content/uploads/2017/12/image4-2.png) If the book is up for grabs, you will see the details of the book -  [![](https://blog.postman.com/wp-content/uploads/2017/12/image7.png)](https://blog.postman.com/wp-content/uploads/2017/12/image7.png) If the book is with someone, you will know who is reading it currently-  [![](https://blog.postman.com/wp-content/uploads/2017/12/image8.png)](https://blog.postman.com/wp-content/uploads/2017/12/image8.png) If the book is unavailable, well, it is time to buy a new book -  [![](https://blog.postman.com/wp-content/uploads/2017/12/image5.png)](https://blog.postman.com/wp-content/uploads/2017/12/image5.png) When you type `/bookbug The Hobbit` in Slack and hit enter, the message (and its data) is sent to the configured external URL (Postman monitor url in our case) via `HTTP POST`. The monitor starts the "Librarian" collection run. [![](https://blog.postman.com/wp-content/uploads/2017/12/Librarian-Slack-App.png)](https://blog.postman.com/wp-content/uploads/2017/12/Librarian-Slack-App.png)## Get Started

### Create an Airtable base (database)

 Create an [Airtable base](https://support.airtable.com/hc/en-us/articles/202576419-Introduction-to-Airtable-bases) with the schema similar to [this base](https://airtable.com/shrSgSkkOcWGdlJ8F). Airtable provides a nice graphical interface to add entries to the base. You can also click on "Copy base" on the top right of [this base](https://airtable.com/shrSgSkkOcWGdlJ8F) to create a copy for yourself. We will use the [Airtable API](https://airtable.com/api) to query this base. ### Create a Slack app (frontend)

 Log in to your team Slack account and [create a Slack app](https://api.slack.com/slack-apps). Then [activate and configure a slash command](https://api.slack.com/slash-commands) and **install this app** to your Slack workspace. You will need to enter the Postman monitor URL which we will create below in the `Request URL` text box. ### Run in Postman

  Click the orange [Run in Postman button](https://learning.postman.com/docs/publishing-your-api/run-in-postman/creating-run-button/) to import the sample collection and environment template into your Postman app. Before you can run the Librarian collection, you need to update the `Librarian.template` [environment](https://learning.postman.com/docs/postman/variables-and-environments/managing-environments/) you downloaded with the **Run in Postman** button. Add appropriate values to the variables: [![](https://blog.postman.com/wp-content/uploads/2017/12/Screen-Shot-2017-12-19-at-12.11.47-PM.png)](https://blog.postman.com/wp-content/uploads/2017/12/Screen-Shot-2017-12-19-at-12.11.47-PM.png)### Create a Postman monitor

 There are currently 2 ways to run a Postman monitor *on-demand*. You can manually run a monitor from the [Postman web dashboard](https://monitor.getpostman.com/), or you can use the [Postman API](https://docs.api.getpostman.com/) to run a monitor, but these methods don't allow you to send a payload. This *on-demand* Postman monitor - which functions like a webhook - will receive the payload sent by Slack and start the "Librarian" collection run. **Note:** [Postman webhooks](https://learning.postman.com/docs/postman/monitors/integrations-for-alerts/) are still under development, and not yet recommended for commercial use. ---

 **Need help getting started?** Check out the [Librarian documentation](https://www.postman.com/postman/workspace/postman-team-collections/documentation/1559645-b46f0393-54a6-455e-9bc1-c1091df5a56a) for step-by-step instructions. [![](https://blog.postman.com/wp-content/uploads/2017/12/Screen-Shot-2017-12-19-at-12.10.26-PM.png)](https://blog.postman.com/wp-content/uploads/2017/12/Screen-Shot-2017-12-19-at-12.10.26-PM.png)---

 This story has also been shared on [the Airtable blog](https://blog.airtable.com/librarian-building-a-serverless-slack-app-using-postman-and-airtable/).