Getting a correct Slack token
Unfortunately, Slack doesn’t provide officially supported API methods for inviting users to Slack groups. We use an undocumented method which comes with some limitations. One of it is an authentication token. It’s needed to be generated manually by a user with Admin role. Follow this step-by-step guide to get one.
Are you an Admin of a Slack channel?
Open a settings panel of your Slack group in a browser and find Team Settings. The URL should be https://[slack group name].slack.com/admin. Then check your role.
If it’s Admin, go to Generating token. If it’s something else, go to the next step.
One of your members is an Admin
As you’re not an Admin, you need to find one or create a new one. Check the list of members to see if you’re lucky.
In case you have an Admin, simply ask her or him to generate a token for you. Go to Generating token step to learn how to do it. Otherwise, check the next step to create a new Admin.
Add a new Admin
To add a new Admin, select a member of your choice and click Make an Admin. If there’s no one on the list of members you want to give admin rights, invite yourself one more time to a different email address.
If you managed to get to this step, get a high five – the hardest part is done.
Now open the link https://api.slack.com/docs/oauth-test-tokens, select your Slack group and click Create token.
You should be logged in as a user with Admin role.