How to Programatically Invite People to Slack Chatrooms

There are scripts that one can use (like Slakin) that let you create user registration forms for Slack. I was poking around in the Slakin code and the Slack API and I extracted the part that actually invites the users. You can use this code to create your own custom invite tools for Slack.

Here is an example of how to invite a user to Slack with Python 3: