: our step-by-step guide

Can't figure out something ? Send us a message

  1. Getting started
  2. Adding bot features
  3. Publishing your bot

: our step-by-step guide

Can't figure out something ? Send us a message

II. Adding bot features

1. Text

Text messages are handled by default.

{
    "output": {
        "text": [
        "a first message",
        "",
        "a second message"
        ]
    }
}

Each message in the text array of your Watson response is displayed in a separate message in Messenger.

Empty messages are not displayed.

2. Quick replies

Quick replies, also called "options" in the Watson Assistant documentation, are a great way to guide the user throughout the conversation.

Quick replies are also handled by default using Watson's response format:

{
  "output": {
    "generic":[
      {
        "response_type": "option",
        "title": "Available options",
        "description": "Please select one of the following options:",
        "options": [
          {
            "label": "Option 1",
            "value": {
              "input": {
                "text": "option 1"
              }
            }
          },
          {
            "label": "Option 2",
            "value": {
              "input": {
                "text": "option 2"
              }
            }
          }
        ]
      }
    ]
  }
}

3. Sending images

The same applies to images, using Watson's response format:

{
    "output": {
        "generic":[
            {
                "response_type": "image",
                "source": "http://example.com/image.jpg",
                "title": "Image example",
                "description": "This is an example image"
            }
        ]
    }
}

4. Receiving attachments

As of today, Akeduk stores the pdf documents and images sent by your users.

If your bot expects an attachment as an answer, you can add those two context variables :

{
    "context": {
        "file_upload": "true",
        "document_type": "<the name of your document>"
    }
}

If the file_upload variable has a value different from true, the attachment will not be uploaded to Akeduk.

When the document is uploaded, it will be named after the document_type value.

Attachments are automatically mapped to the corresponding conversation, accessible from the Akeduk interface :

When a user uploads a document, a FILE_UPLOADED message is sent to Watson Assistant.

You have to configure a dialog node to correctly process this message, so that the conversation can keep going.

5. URL button

URL buttons are used to redirect an user towards a webpage outside Messenger.

The button variable allows you to display one:

{
    "output": {
        "button": {
            "url" : "<your url>",
            "title" : "<button text>"
        }
    }
}

By Messenger standards, the title of a button cannot exceed 20 characters.

6. Storing conversations

By default, Akeduk stores all the conversations, per user, in one place.

However, you might want to divide a user's conversation in several ones.

In order to do that, you can use the new_case variable provided by Akeduk:

{
    "output": {
        "new_case": "true"
    }
}

When the variable is encountered, a new conversation is added to the section dedicated to the corresponding user :

Screenshot conversations stored

A Messenger conversation keeps going from where the user left off in its most recently stored conversation.

7. Storing Watson contexts

Watson context variables other than system and conversation_id are automatically stored by Akeduk to help you with custom business logic :

Screenshot Watson context variables in a conversation

Any feature you would like us to add ? Contact us

Finally, you will have to release your bot to the public in production mode :