laravel-slack-api
laravel-slack-api copied to clipboard
Channel join method returning error: missing required field channel
I'm using this code to join the channel:
SlackChannel::join('C1234567890')
In the response I'm getting this error message:
"ok" => false
"error" => "invalid_arguments"
"message" => "[ERROR] missing required field: channel"
When I check the join method inside Vluzrmos\SlackApi\Methods\Channel I found this code:
public function join($name) { return $this->method('join', ['name' => $name]); }
Here, in argument we are passing name. But when I check Slack API documentation I found this: Required arguments:
- token
- channel
When I changed parameter in join method from name to channel then it is working fine. Code inside inside Vluzrmos\SlackApi\Methods\Channel after change:
public function join($name) { return $this->method('join', ['channel' => $name]); }
Can you please look into this? Also, if I'm missing something then let me know. If anyone needs additional information then let me know.
Seems like the same problem is occurring in several places. https://api.slack.com/methods/conversations.invite
https://github.com/vluzrmos/laravel-slack-api/blob/6fd8c3d584c78809ac2b29e6d3f3ed1ff0e5bcc9/src/Vluzrmos/SlackApi/Methods/Channel.php#L78-L81
Had the same issue. Made a pull request just in case you would feel it's usefull.
thank you very much for all the hard work creating this library.