nestjs-slack
nestjs-slack copied to clipboard
ERROR [ExceptionsHandler] An API error occurred: not_authed
Hi Everyone,
Hope you guys are doing great. I am using this package to send messages to the slack using SlackServide.postMessage() method. While calling it I am getting this issue. Can anyone help to resolve that issue?
Here is the sample code:
constructor(private readonly slackService: SlackService) {}
this.slackService.postMessage(payload);
Hello,
Which version are you using? API, Webhook or Google Cloud Logger?
I'm using API version.
Okay, have you made sure the API key is valid? Maybe using curl or Postman to test?
Note: You might have used the wrong key.
Yes, I am using the BOT Token to send the message. I verified that using Postman it's working fine. Here is how actually I configured it with the module.
SlackModule.forRoot({
type: 'api',
token: process.env.SLACK_BOT_TOKEN,
isGlobal: true,
}),