Skip to main content

REFERENCE

Developer Reference

Authentication, APIs, SDKs, Flow Agent processors and parameter resolution, in full.

Text

Text is the message template for sending text.

  1. Basic usage​

    Text shows written content in the chat interface.

  2. Template structure​

    JSON​

    {
    "type": "TEXT",
    "text": "Hello! Welcome to the Asgard assistant."
    }

    Properties​

    type (required)​

    The message template's type, always "TEXT".

    text (required)​

    The text to show the user. Multi-line text is supported, using \n for line breaks.

    quickReplies (optional)​

    An array of quick reply buttons. See Quick Replies.

  3. Examples​

    To send text from Push Message:

    1. Choose Expression in the Template field's dropdown.
    2. Enter the following JavaScript in the editor.

    A plain text message​

    (() => {
    return {
    type: 'TEXT',
    text: 'Your order has been created. Order number: #12345',
    };
    })()

    Multi-line text​

    (() => {
    return {
    type: 'TEXT',
    text: 'Your order has been created.\nOrder number: #12345\nExpected delivery in 3 to 5 working days.',
    };
    })()

    With quick replies​

    (() => {
    return {
    type: 'TEXT',
    text: 'What would you like to know more about?',
    quickReplies: [
    {
    text: 'See the details',
    },
    {
    text: 'Buy',
    },
    ],
    };
    })()

Ready to get started?

Want to see how Asgard fits your team? Talk to us.

Contact us