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

How Send Channels in users.admin.invite? #31

Closed
duraiganesh0 opened this issue Jan 21, 2018 · 3 comments
Closed

How Send Channels in users.admin.invite? #31

duraiganesh0 opened this issue Jan 21, 2018 · 3 comments

Comments

@duraiganesh0
Copy link

i dont know how to send the channels parameter in users.admin.invite.
i'm currently sending the channels as a list like this
channels = ["C8687"]
and got this response {'ok': False, 'error': 'channel_not_found'}
How to send this paramter. FYI i'm using slack_client package in python.

@ErikKalkoken
Copy link
Owner

It depends how your channels variable is later combined into the http query to Slack. In general you need to send the list of channel IDs as http query parameter.
Example:
https://slack.com/api/users.admin.invite?token=TOKEN&email=abc@xyz,com&channels=C1234567890,G12345678

@duraiganesh0
Copy link
Author

i'm currently sending like this.
sc = SlackClient("xoxp-3434545-565656-2342342-2gb5h6y66")
def invite_user(name,email):
resp = sc.api_call(
"users.admin.invite",
first_name=name,
email=email,
channels='C4GHT66',
resend=True,
validate=True,
)
print(resp)

is this correct?

@ErikKalkoken
Copy link
Owner

I don't know much about Python or the slack_client package, but it looks ok. Do you still get the error?

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

2 participants