Examples for Ratatoskr Message

From Message.yaml (ratatoskr/Message.schema)

# Container Types
---
type: message
message:
  type: quick_replies
  quick_replies:
    - type: quick_reply
      quick_reply:
        text: Quick Reply 1
        url: botmd://hospital/postMessage?text=Quick%20Reply%201

    - type: quick_reply
      quick_reply:
        text: Quick Reply 2
        url: botmd://hospital/postMessage?text=Hello+World
  #end quick_replies
#end message

---
type: message
message:
  type: text
  text: Hi there!
reply_to:
  replyee_message:
    type: message
    message:
      type: text
      text: Hello Bot
  delivery_uid: xxxxx12345
  author: Oppie
  replied_on: "2024-08-02T12:00:00+00:00"

---
type: message
message:
  type: text
  text: Hi there!
reply_to:
  replyee_message:
    type: message
    message:
      type: text
      text: Hello Bot
  delivery_uid: null
  author: Oppie
  replied_on: "2024-08-02T12:00:00+00:00"

---
type: message
message:
  type: sections
  sections:
    - type: paragraphs
      paragraphs:
        - type: text
          text: This is a test text.
---
type: message
message:
  type: sections
  sections:
    - type: video
      video:
        url: https://www.example.com/video.mp4
        preview_autostart: true
        preview_image:
          url: https://www.example.com/preview_image.jpg
          actionable:
            url: https://www.example.com/video.mp4
            content_type: video/mp4
    #end video

    - type: paragraphs
      paragraphs:
        - type: title
          title: Hello World
        - type: subtitle
          subtitle: This is a subtitle.
        - type: text
          text: This is a long description text.
    #end paragraphs
    - type: actions
      actions:
        - type: button
          button:
            text: Link 1
            url: ${random_url}
            content_type: text/html
            external_browser: true

        - type: button
          button:
            text: Link 2
            url: https://www.example.com
            content_type: text/html

        - type: button
          button:
            text: Link 3
            url: https://www.example.com
            content_type: text/html
      #end actions
  #end sections
#end message

---
type: message
message:
  type: paragraphs
  paragraphs:
    - type: title
      title: Hello World
    - type: subtitle
      subtitle: This is a subtitle.
    - type: text
      text: This is a long description text.
  #end paragraphs
#end message

---
type: message
message:
  type: actions
  actions:
    - type: button
      button:
        text: Button 1
        url: https://www.example.com
        content_type: text/html
        external_browser: true

        event:
          type: Button 1 Clicked
          properties:
            text: Button 1
            url: https://www.example.com
        #end event

    - type: button
      button:
        text: Button 2
        style: cta
        url: https://www.example.com
        content_type: text/html

    - type: button
      button:
        text: Button 3
        style: link
        url: https://www.example.com
        content_type: text/html
  #end actions
#end message

# Quick Reply Types
---
type: message
message:
  type: quick_reply
  quick_reply:
    text: Quick Reply
    url: botmd://hospital/postMessage?text=Quick+Reply

---
type: message
message:
  type: quick_reply
  quick_reply:
    text: Quick Reply
    url: botmd://hospital/postMessage?text=Quick+Reply
    event:
      type: Quick Reply Clicked
      properties:
        text: Quick Reply
        url: https://www.example.com

---
type: message
message:
  type: quick_reply
  quick_reply:
    text: Quick Reply
    url: botmd://hospital/postMessage?text=Hello+World

# Media Types
---
type: message
message:
  type: image
  image:
    url: https://www.example.com/image.png

---
type: message
message:
  type: image
  image:
    url: https://www.example.com/image.png
    actionable:
      url: https://www.example.com/image.png
      content_type: image/png

      event:
        type: Image Clicked
        properties:
          text: Image
          url: https://www.example.com/image.png

---
type: message
message:
  type: audio
  audio:
    url: https://www.example.com/audio.wav
    preview_image:
      url: https://www.example.com/preview_image.jpg
      scale: center

---
type: message
message:
  type: video
  video:
    url: https://www.example.com/video.mp4
    preview_autostart: true
    preview_image:
      url: https://www.example.com/preview_image.jpg
      actionable:
        url: https://www.example.com/video.mp4
        content_type: video/mp4

---
type: message
message:
  type: attachment
  attachment:
    url: https://www.example.com/attachment.pdf
    preview_image:
      url: https://www.example.com/preview_image.jpg
      actionable:
        url: https://www.example.com/attachment.pdf
        content_type: application/pdf

---
type: message
message:
  type: attachment
  attachment:
    url: https://www.example.com/attachment.pdf
    filename: anothername.pdf
    content_type: application/pdf

---
type: message
message:
  type: attachment
  attachment:
    url: https://www.example.com/attachment.pdf
    filename: anothername.pdf
    content_type: application/pdf
    einstein:
      document_uid: abcde12345

# Text Types
---
type: message
message:
  type: title
  title: Hello World

---
type: message
message:
  type: subtitle
  subtitle: This is a subtitle.

---
type: message
message:
  type: text
  text: This is a long description text.

# Action Types
---
type: message
message:
  type: button
  button:
    text: Link 1
    url: https://www.example.com
    content_type: text/html
    external_browser: true

# Location Types
---
type: message
message:
  type: location_request
  location_request:
    text: Please share your location with me.

---
type: message
message:
  type: location_response
  location_response:
    name: Bot MD
    address: "71 Ayer Rajah Crescent, #07-21, Singapore 139551"
    latitude: 1.296813
    longitude: 103.786812

# Carousel where each item is one of the ☝️ valid types
---
type: message
message:
  type: carousel
  carousel:
    - type: sections
      sections:
        - type: video
          video:
            url: https://www.example.com/video.mp4
            preview_autostart: true
            preview_image:
              url: https://www.example.com/preview_image.jpg
              actionable:
                url: https://www.example.com/video.mp4
                content_type: video/mp4
        #end video

        - type: paragraphs
          paragraphs:
            - type: title
              title: Hello World
            - type: subtitle
              subtitle: This is a subtitle.
            - type: text
              text: This is a long description text.
        #end paragraphs
        - type: actions
          actions:
            - type: button
              button:
                text: Link 1
                url: https://www.example.com
                content_type: text/html
                external_browser: true

            - type: button
              button:
                text: Link 2
                url: https://www.example.com
                content_type: text/html

            - type: button
              button:
                text: Link 3
                url: https://www.example.com
                content_type: text/html
          #end actions
      #end sections

    - type: paragraphs
      paragraphs:
        - type: title
          title: Hello World
        - type: subtitle
          subtitle: This is a subtitle.
        - type: text
          text: This is a long description text.
      #end paragraphs

    - type: actions
      actions:
        - type: button
          button:
            text: Button 1
            url: https://www.example.com
            content_type: text/html
            external_browser: true

        - type: button
          button:
            text: Button 2
            style: cta
            url: https://www.example.com
            content_type: text/html

        - type: button
          button:
            text: Button 3
            style: link
            url: https://www.example.com
            content_type: text/html
      #end actions

    - type: image
      image:
        url: https://www.example.com/image.png

    - type: video
      video:
        url: https://www.example.com/video.mp4
        preview_autostart: true
        preview_image:
          url: https://www.example.com/preview_image.jpg
          actionable:
            url: https://www.example.com/video.mp4
            content_type: video/mp4

    - type: title
      title: Hello World

    - type: text
      text: This is a long description text.

    - type: button
      button:
        text: Button 1
        style: cta
        url: https://www.example.com
        content_type: text/html
  #end carousel
#end message

---
# Favoritable message
type: message
message:
  type: text
  text: Hey! How are you today?
favorite:
  title: Hello
  url: botmd://hospital/jarvisQuery?uid=xxx

---
# Favoritable message
type: message
message:
  type: text
  text: The weather today is great.
favorite:
  title: Hello
  url: botmd://hospital/jarvisQuery?uid=xxx
  expires_on: "2018-11-13T20:20:39.12345+00:00"

---
# Favoritable carousel
type: message
message:
  type: carousel
  carousel:
    - type: sections
      sections:
        - type: video
          video:
            url: https://www.example.com/video.mp4
            preview_autostart: true
            preview_image:
              url: https://www.example.com/preview_image.jpg
              actionable:
                url: https://www.example.com/video.mp4
                content_type: video/mp4
        #end video

        - type: paragraphs
          paragraphs:
            - type: title
              title: Hello World
            - type: subtitle
              subtitle: This is a subtitle.
            - type: text
              text: This is a long description text.
        #end paragraphs
        - type: actions
          actions:
            - type: button
              button:
                text: Link 1
                url: https://www.example.com
          #end actions
      #end sections
      favorite:
        title: Video
        url: botmd://hospital/jarvisQuery?uid=xxx

    - type: paragraphs
      paragraphs:
        - type: title
          title: Hello World
        - type: subtitle
          subtitle: This is a subtitle.
        - type: text
          text: This is a long description text.
      #end paragraphs
      favorite:
        title: Hello
        url: botmd://hospital/jarvisQuery?uid=xxx
        expires_on: "2018-11-13T20:20:39.12345+00:00"

    - type: actions
      actions:
        - type: button
          button:
            text: Button 1
            url: https://www.example.com
            content_type: text/html
            external_browser: true

        - type: button
          button:
            text: Button 2
            style: cta
            url: https://www.example.com
            content_type: text/html

        - type: button
          button:
            text: Button 3
            style: link
            url: https://www.example.com
            content_type: text/html
      #end actions
      favorite:
        title: Actions
        url: botmd://hospital/jarvisQuery?uid=xxx
  #end carousel
#end message

---
# WhatsApp template
type: message
message:
  type: whatsapp_template
  whatsapp_template:
    namespace: 20332cd4_f095_b080_d255_35677159aaff # example copied from MessageBird website
    template_name: order_update
    language_code: en

    body_parameters:
      - default: Bob
      - default: tomorrow!
  #end whatsapp_template
#end message

---
type: message
message:
  type: whatsapp_template
  whatsapp_template:
    namespace: xxxxx
    template_name: thank_you
    fallback_text: Thank you for using Bot MD
    language_code: en
  #end whatsapp_template
#end message

---
type: message
message:
  type: whatsapp_template
  whatsapp_template:
    namespace: 20332cd4_f095_b080_d255_35677159aaff # example copied from MessageBird website
    template_name: test_media_complex

    header_parameters:
      - type: document
        document:
          url: https://example.com/flight.pdf
          caption: flight.pdf

    body_parameters:
      - type: text
        text: TK 1073

      - type: text
        text: "18.04.2020"
  #end whatsapp_template
#end message

---
type: message
message:
  type: whatsapp_template
  whatsapp_template:
    namespace: 20332cd4_f095_b080_d255_35677159aaff # example copied from MessageBird website
    template_name: test_buttons

    button_parameters:
      - url: https://example.com/button1?query

      - url: https://example.com/button2?query
        index: 1
  #end whatsapp_template
#end message

---
type: message
message:
  type: application_payload
  application_payload:
    application: xxxxx
    payload:
      hello: world
    #end payload
  #end data
#end message

---
type: message
message:
  type: empty

---
type: message
message:
  type: email
  email:
    subject: Hello World

    text: >-
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pharetra elementum tristique. Ut auctor, turpis quis porta vulputate, elit tellus tincidunt massa, at maximus neque velit tincidunt dolor.

      Quisque hendrerit gravida odio, vitae condimentum nisi lobortis vitae. Suspendisse a augue eu nisi hendrerit dapibus. Nullam in nibh vel libero efficitur vestibulum id ut justo.

    html: >-
      <!DOCTYPE html>
      <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width,initial-scale=1">
            <meta name="x-apple-disable-message-reformatting">
            <title></title>
            <!--[if mso]>
            <noscript>
                <xml>
                    <o:OfficeDocumentSettings>
                        <o:PixelsPerInch>96</o:PixelsPerInch>
                    </o:OfficeDocumentSettings>
                </xml>
            </noscript>
            <![endif]-->
            <style>
                table, td, div, h1, p {font-family: Arial, sans-serif;}
                table, td {border:2px solid #000000 !important;}
            </style>
        </head>
        <body style="margin:0;padding:0;">
            <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
                <tr>
                    <td align="center" style="padding:0;">
                        Hello World
                    </td>
                </tr>
            </table>
        </body>
      </html>

    attachments:
      - url: https://www.example.com/attachment.pdf
        filename: different.pdf

      - url: s3://example/attachment.pdf
  #end email
#end message

---
type: message
message:
  type: email
  email:
    subject: This is an empty email

    text: ""
  #end email
#end message

---
type: message
message:
  type: text
  text: Lorem ipsum dolor sit amet, consectetur adipiscing elit.

provider_metadata:
  messenger:
    message_tag: CONFIRMED_EVENT_UPDATE
#end message

---
message:
  carousel:
    - favorite:
        title: ${title[ktph-documents-einstein][0]}
        url: ${favorite_url[ktph-documents-einstein][0]}
      sections:
        - image:
            url: https://hippocrates.production.botmd.io/v1/partner/logos/ktph/full.png
          type: image
        - paragraphs:
            - title: ${title[ktph-documents-einstein][0]}
              type: title
            - subtitle: ${subtitle[ktph-documents-einstein][0]}
              type: subtitle
          type: paragraphs
        - actions:
            - button:
                content_type: text/html
                style: link
                text: ${button_text[ktph-documents-einstein][0]}
                url: ${button_url[ktph-documents-einstein][0]}
              type: button
            - button:
                content_type: text/html
                style: link
                text: ${button_text_2[ktph-documents-einstein][0]}
                url: ${button_url_2[ktph-documents-einstein][0]}
              type: button
          type: actions
      type: sections
  type: carousel
type: message

---
message:
  carousel:
    - favorite:
        title: pie chart
        url: botmd://hospital/jarvisQuery?uid=m42W9qHeY6689DDZku0ZdclM6uVZWpULAml9HPc7ZE8%3D
      sections:
        - image:
            url: https://hippocrates.production.botmd.io/v1/partner/logos/ktph/full.png
          type: image
        - paragraphs:
            - title: pie chart
              type: title
            - subtitle: "2023"
              type: subtitle
          type: paragraphs
        - actions:
            - button:
                content_type: text/html
                style: cta
                text: View File
                url: ${document_url}
              type: button
            - button:
                content_type: text/html
                style: cta
                text: Find Within
                url: ${button_url_2[ktph-documents-einstein][0]}
              type: button
          type: actions
      type: sections
  type: carousel
type: message

---
message:
  sections:
    - paragraphs:
        - text: Hello! My name is IRIS 😎👋 I can help answer your questions about cataracts and Cataract surgery. Ask me a question or tap any of the options below.
          type: text
      type: paragraphs
    - actions:
        - button:
            content_type: text/html
            style: cta
            text: Symptoms
            url: botmd://ratatoskr/postMessage?text=Symptoms+Cataract
          type: button
        - button:
            content_type: text/html
            style: cta
            text: Preventing Cataracts
            url: botmd://ratatoskr/postMessage?text=Preventing+Cataracts
          type: button
      type: actions
  type: sections
type: message

---
message:
  carousel:
    - sections:
        - image:
            url: https://botmd-staging-hippocrates-static.s3.amazonaws.com/hospital/KTPH/full_size.png
          type: image
        - paragraphs:
            - title: Roster
              type: title
            - subtitle: Daily on call
              type: subtitle
            - text: Last synced on Sep 27 (Wed)
              type: text
          type: paragraphs
        - actions:
            - button:
                content_type: text/html
                style: cta
                text: Open
                url: https://stitch-v3.staging.botmd.io/PMW7OGMxwsL7jFb5.html
              type: button
          type: actions
      type: sections
  type: carousel
type: message

---
type: message
message:
  type: sections
  sections:
    - type: paragraphs
      paragraphs:
        - type: title
          title: Hello World
        - type: subtitle
          subtitle: This is a subtitle.
        - type: text
          text: This is a long description text.

---
type: message
message:
  type: sections
  sections:
    - type: paragraphs
      paragraphs:
        - type: title
          title: Hello World
        - type: subtitle
          subtitle: This is a subtitle.
        - type: text
          text: This is a long description text.
    - type: attachment
      attachment:
        url: 'https://www.example.com/attachment.pdf'
  #end sections
#end message


[Main Page] [Schema Documentation] [Raw Schema] [JSON Schema]