Describe your issue here.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
slackclient version: 2.7.2
python version: 3.7
OS version(s): MacOS 10.15
1.
2.
3.
What you expected to happen: Post a message to the specified slack channel
What actually happened: Error
Logs, screenshots, screencast, sample project, funny gif, etc.
self.slack_client.api_call(
"chat.postMessage",
channel=ChannelName Or Channel Id, #Using the right channel name/id here
text=SomeMessage #Using a random string
I am expecting this method to post a message. But this code errors out with api_call() got an unexpected keyword argument 'channel'. Am I missing some parameter or am I calling the method wrong? Not sure as to why it errors out. The method slack_client.chat_postMessage works fine, but not slack_client.api_call
馃憢 Thanks for asking!
For the general api_call method you should pass a dictionary of the API arguments to the json parameter in this case. In fact, it looks like this example in the docs is exactly like your own example.
client.api_call(
api_method='chat.postMessage',
json={'channel': '#random', 'text': 'Hello world!'}
)
This be beautiful. This worked. Thank You!
Most helpful comment
馃憢 Thanks for asking!
For the general
api_callmethod you should pass a dictionary of the API arguments to thejsonparameter in this case. In fact, it looks like this example in the docs is exactly like your own example.