jamietsao / slack-multi-channel-invite

Script to invite a user to multiple Slack channels at once
25 stars 10 forks source link

Fix Slack API auth #7

Closed jamietsao closed 3 years ago

jamietsao commented 3 years ago

An issue (https://github.com/jamietsao/slack-multi-channel-invite/issues/6) was reported that invalid_auth errors were being returned. After lots of head scratching, I finally found that supplying the api token via query param suddenly stopped working (even though their docs say it's a valid way: https://api.slack.com/authentication/oauth-v2#using)

Updated the users.lookupByEmail and conversations.list calls to supply api token via a header (the conversations.invite call was already being done this way).