Bubble {#bubble}

A bubble is a container that contains a single message bubble. It consists of four blocks: header , hero , body , and footer . For more information about the blocks, see Block in Flexible Template Elements.

The maximum size of JSON data defining a bubble is limited to 30 KB.

Request

ParameterTypeRequiredDescription
typestringYSet this parameter to bubble.
sizestringNBubble size. Specify one of the following values: nano, micro, kilo, mega, and giga .

The default value is mega .
directionstringNThe direction of the string. In a horizontal box, it is the direction in which child components are positioned. Specify one of the following values:

• ltr: Displays the text string and components from left to right.
• rtl: Displays the text string and components from right to left.

The default value is ltr.
headerobjectNHeader block. Set this parameter to Box.
heroobjectNHero block. Set this parameter to Box or Image.
bodyobjectNBody block. Set this parameter to Box.
footerobjectNFooter block. Set this parameter to Box.
stylesobjectNBlock style. Specify a bubble style described below.
actionobjectNThe action that occurs when the bubble is tapped. Specify an action object .

Block style object {#bubble-style}

You can define the block style of a bubble using the following two objects:

Bubble style {#bubble-style}

ParameterTypeRequiredDescription
headerobjectNHeader block. Specify a block style described below.
heroobjectNHero block. Specify a block style described below.
bodyobjectNBody block. Specify a block style described below.
footerobjectNFooter block. Specify a block style described below.

Block style {#block-style}

ParameterTypeRequiredDescription
backgroundColorstringNBackground color of the block. Set a hex color code.
separatorbooleanNIf it is set to true, a separator is displayed over the block. The default value is false.
separatorColorstringNSeparator color. Set a hex color code.

Note

  • A separator cannot be specified for the block located at the very beginning.

Request example {#bubble-request-example}

{  "type": "bubble",  "header": {    "type": "box",    "layout": "vertical",    "contents": [      {        "type": "text",        "text": "Text Component",        "weight": "bold"      }    ],    "paddingAll": "10px",    "paddingStart": "15px"  },  "hero": {    "type": "image",    "url": "https://developers.worksmobile.com/image/en/bot/message_type/Image-Component.png",    "size": "full",    "aspectMode": "cover",    "aspectRatio": "2:1"  },  "body": {    "type": "box",    "layout": "vertical",    "contents": [      {        "type": "box",        "layout": "horizontal",        "contents": [          {            "type": "box",            "layout": "vertical",            "contents": [              {                "type": "image",                "url": "https://developers.worksmobile.com/image/en/bot/message_type/Image.png",                "size": "lg"              }            ],            "borderWidth": "2px",            "borderColor": "#90909050",            "width": "93px",            "height": "93px"          },          {            "type": "box",            "layout": "vertical",            "contents": [              {                "type": "separator",                "color": "#909090"              },              {                "type": "text",                "text": "Text Component 01"              },              {                "type": "separator",                "color": "#909090"              },              {                "type": "text",                "text": "Text Component 02"              },              {                "type": "separator",                "color": "#909090"              }            ],            "height": "100px",            "margin": "md",            "spacing": "lg"          }        ]      },      {        "type": "box",        "layout": "horizontal",        "contents": [          {            "type": "box",            "layout": "vertical",            "contents": [              {                "type": "image",                "url": "https://developers.worksmobile.com/image/en/bot/message_type/Image.png",                "size": "lg"              }            ],            "borderWidth": "2px",            "borderColor": "#90909050",            "width": "93px",            "height": "93px"          },          {            "type": "box",            "layout": "vertical",            "contents": [              {                "type": "separator",                "color": "#909090"              },              {                "type": "text",                "text": "Text Component 03"              },              {                "type": "separator",                "color": "#909090"              },              {                "type": "text",                "text": "Text Component 04"              },              {                "type": "separator",                "color": "#909090"              }            ],            "height": "100px",            "margin": "md",            "spacing": "lg"          }        ],        "margin": "md"      }    ]  },  "footer": {    "type": "box",    "layout": "vertical",    "contents": [      {        "type": "button",        "action": {          "type": "uri",          "label": "Button Component",          "uri": "https://works.do/"        },        "height": "sm",        "style": "link"      }    ]  }}