vluzrmos / laravel-slack-api

Laravel e Lumen Wrapper for Slack.com Web API: https://api.slack.com
99 stars 60 forks source link

Channel join method returning error: missing required field channel #38

Open haresh-p opened 1 year ago

haresh-p commented 1 year ago

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:

  1. token
  2. 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.

naiguchi commented 1 year ago

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

coupej commented 1 year ago

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.