BlakeWilliams / Elixir-Slack

Slack real time messaging and web API client in Elixir
MIT License
674 stars 183 forks source link

Slack API returned an error invalid_auth #261

Open vishal-h opened 7 months ago

vishal-h commented 7 months ago

Following the example in https://github.com/BlakeWilliams/Elixir-Slack#real-time-messaging-rtm-bot-usage

Slack.Bot.start_link(SlackRtm, [], "xoxb-some-token") gives the error

{:error,  "Slack API returned an error `invalid_auth.\n Response: {\"ok\":false,\"error\":\"invalid_auth\"}"}

The same token works fine when tested with kino_slack or

POST https://slack.com/api/chat.postMessage
Content-type: application/json
Authorization: Bearer xoxb-some-token

{
  "channel": "some-channel",
  "text": "Hello world :handshake:"
}