'slack api files.upload error: not_in_channel

trying to upload a file from a build server following the doc: https://api.slack.com/methods/files.upload

And also using bot token: https://api.slack.com/authentication/basics

I am getting the error: {"ok":false,"error":"not_in_channel"}

Appreciate any help and pointers!



Solution 1:[1]

This error occurs when a bot oauth token is used and the bot isn't in the target channel(s).

To fix:

  • Go into target channel(s)
  • Type /invite @BOT_NAME
  • Retry the request

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1