It’s really easy and powerful to work with API.AI as a tool for creating your bots. Not only you are getting a powerful machine learning algorithm to understand your users, you get in the same time an easy way to integrate with many services (e.g. Google Home, Twitter, Facebook messenger, Slack, Telegram, Skype and many more).
What is API.AI?
API.AI is a natural language understanding platform that makes it easy for developers to design and integrate intelligent and sophisticated conversational user interfaces into mobile apps, web applications, devices, and bots.
If you never worked with API.AI – You can check it out in this post.
What is Slack?
I just copied from this site, because it’s short and to the point:
Where work* happens.
*Whatever work means for you, Slack brings all the pieces and people you need together so you can actually get things done.
If you are a developer that worked with IRC in the past – Slack is a (much) ‘nicer’ version of it. You get the productivity of a mobile chat tool with many options for integrations and automations.
- Create a new Slack App by using the link. You will need to have an account so make sure to create one and login with it.
- In the Slack App, go to the ‘Bot users’ section and click the ‘Add a Bot User’ button.
- Enable events in the ‘Event Subscriptions’ section.
- Select necessary events in “Subscribe to Bot Events” section.
Popular events you might wish to listen:
These events will define which message types (direct, in channel, etc.) your bot will react to. After you making your selection, remember to save changes.
(!) It’s important to choose the minimal (but functional) set of events you want to subscribe. Since you don’t want to have too many events that aren’t necessary and might intimidate the user when she installing your bot.
See below an example:
And for bot events you want something like:
- Now, go to ‘Basic Information’ section, copy the ‘Client ID’ and ‘Client Secret’ and paste their values into the respective fields below.
- Start the bot. You can see it in the above image. It’s the last step at the bottom of the dialog.
- Copy the ‘OAuth URL’ value below and paste it into the ‘Redirect URL(s)’ field from the ‘OAuth & Permissions’ section of your Slack app settings.
- Copy Events Request URL from the field below and paste it to Request URL in the ‘Events Subscription’ section of your Slack app.
- In the Slack app settings, go to ‘Manage Distribution’ and add the bot to your Slack team using the ‘Add to Slack’ button.
Give it a try in your Slack right now, while it’s all fresh in your mind.