A carousel is a container that contains multiple bubbles as child elements. Users can scroll horizontally through the bubbles.

    The maximum size of JSON data that defines a carousel is 15 KB.

    API Type

    Server API

    Request URL

    https://apis.worksmobile.com/r/{API ID}/message/v1/bot/{botNo}/message/push

    HTTP Method

    POST(Content-Type: application/json; charset=UTF-8)

    Request Content

    Parameter Type Required Description
    type string Y Set this parameter to carousel.
    contents string Y Bubbles in the carousel. Max: 10 bubbles.

    Note

    • Bubble width
      • A carousel cannot contain bubbles of different widths (size property). Each bubble in a carousel should have the same width.
    • Bubble height
      • The body of each bubble will stretch to match the bubble with the greatest height in the carousel. However, bubbles with no body will not change height.

    Request Example

    
    {
      "type": "carousel",
      "contents": [
        {
          "type": "bubble",
          "body": {
            "type": "box",
            "layout": "horizontal",
            "contents": [
              {
                "type": "text",
                "text": "The Message Bot API enables the client to interact with individual users, by using a message bot account.",
                "wrap": true
              }
            ]
          },
          "footer": {
            "type": "box",
            "layout": "horizontal",
            "contents": [
              {
                "type": "button",
                "style": "primary",
                "action": {
                  "type": "uri",
                  "label": "See more",
                  "uri": "http://worksmobile.com"
                },
                "height": "sm"
              }
            ]
          }
        },
        {
          "type": "bubble",
          "body": {
            "type": "box",
            "layout": "horizontal",
            "contents": [
              {
                "type": "text",
                "text": "Hello, World!",
                "wrap": true
              }
            ]
          },
          "footer": {
            "type": "box",
            "layout": "horizontal",
            "contents": [
              {
                "type": "button",
                "style": "primary",
                "action": {
                  "type": "uri",
                  "label": "See more",
                  "uri": "http://worksmobile.com"
                },
                "height": "sm"
              }
            ]
          }
        }
      ]
    }
    

    Response

    It returns HTTP status 200 with no response if successful.

    Error Code

    If the API call fails, it returns an error code and message.
    For error codes, refer to Message Bot REST API Error Codes.