You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebClient chat_postMessage doesn't support input blocks.
This may be similar to #853 where an excessive input validation needed to be removed. #519 also looks mildly similar.
Category (place an x in each of the [ ])
slack_sdk.web.WebClient (sync/async) (Web API client)
It appears that not all valid elements in block kit tool can be posted as a message, despite the fact that message preview works fine in the Block Tool.
In my case, the code failed when I included an input block and passed when i removed it. The input block was generated by the Block Kit tool and it looked fine when selecting "Message Preview".
The error was {'ok': False, 'error': 'invalid_blocks'}
If messages are not meant to support input fields, then the Message Preview should fail in Block Kit Tool. It doesn't.
Also, although the documentation for python says you need to urlEncode the JSON-based array, there is no example of using "blocks" in the python sample code, and the description at https://api.slack.com/methods/chat.postMessage#arg_blocks is incorrect. Documentation fix needed
I've checked your gist and found that the reason why your code is getting "invalid_blocks" error code from the server side is that you have an input block element under an "actions" block, which is not available in Block Kit. Your app needs to have any blocks at the top level, not under a block.
You can see the detailed error in Block Kit Builder here.
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.
WebClient chat_postMessage doesn't support input blocks.
This may be similar to #853 where an excessive input validation needed to be removed. #519 also looks mildly similar.
Category (place an
x
in each of the[ ]
)It appears that not all valid elements in block kit tool can be posted as a message, despite the fact that message preview works fine in the Block Tool.
In my case, the code failed when I included an input block and passed when i removed it. The input block was generated by the Block Kit tool and it looked fine when selecting "Message Preview".
The error was
{'ok': False, 'error': 'invalid_blocks'}
If messages are not meant to support input fields, then the Message Preview should fail in Block Kit Tool. It doesn't.
Also, although the documentation for python says you need to urlEncode the JSON-based array, there is no example of using "blocks" in the python sample code, and the description at https://api.slack.com/methods/chat.postMessage#arg_blocks is incorrect. Documentation fix needed
You can see on line 29 in the SDK test code below that
blocks=
takes a regular list of dicts, not a string.https://github.com/slackapi/python-slack-sdk/blob/c9dc6aa0907a72c16cf36aa15e7e80031a9fdce2/integration_tests/samples/basic_usage/sending_a_message.py
I've created a gist to reproduce the issue https://gist.github.com/kbroughton/e46edc3f6454c8dc33a09431b5685a6c
The text was updated successfully, but these errors were encountered: