<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Okta Workflows -"invalid_blocks" Error Received Using the Send Message to Channel Card
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

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"

 

Applies To
  • Slack connector Send Message to Channel action card
  • Okta Workflows
  • Slack Blocks
Cause

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"
    }
   ]
  }
]
}

 

Solution

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": 


 

Recommended content

Loading
Okta Workflows -"invalid_blocks" Error Received Using the Send Message to Channel Card