When using the Slack connector Send Message to Channel card with the Message Type option set to Blocks and the Blocks input set to the JSON generated by the Slack Block Kit, the following error occurs:
message": "invalid_blocks",
"code": 400,
"description": "HTTP Request Error"
- Slack connector Send Message to Channel action card
- Okta Workflows
- Slack Blocks
Using the format from the Block Kit Builder provided by Slack to test API calls, such as the following, will result in the invalid blocks error.
{
"blocks": [
{
"type": "actions",
"block_id": "actions1",
"elements": [
{
"type": "static_select",
"placeholder": {
"type": "plain_text",
"text": "Which witch is the witchiest witch?"
},
"action_id": "select_2",
"options": [
{
"text": {
"type": "plain_text",
"text": "Matilda"
},
"value": "matilda"
},
{
"text": {
"type": "plain_text",
"text": "Glinda"
},
"value": "glinda"
},
{
"text": {
"type": "plain_text",
"text": "Granny Weatherwax"
},
"value": "grannyWeatherwax"
},
{
"text": {
"type": "plain_text",
"text": "Hermione"
},
"value": "hermione"
}
]
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Cancel"
},
"value": "cancel",
"action_id": "button_1"
}
]
}
]
}
The blocks key from the previous message needs to be removed. Leave only the list. In order to do so, please remove the following part from the text/JSON, as well as the associated start and end parts of the object. (the {} signs).
"blocks":
