Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haresh-p opened this issue Apr 4, 2023 · 2 comments
Open

Comments

@haresh-p
Copy link

haresh-p commented Apr 4, 2023

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
Copy link

naiguchi commented Apr 6, 2023

Seems like the same problem is occurring in several places.
https://api.slack.com/methods/conversations.invite

public function invite($channel, $user)
{
return $this->method('invite', compact('channel', 'user'));
}

@coupej
Copy link
Contributor

coupej commented Apr 13, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants