Receiving Messages

This documentation is preliminary and is subject to change at any given moment.

Messages can originate from different sources and can contain various Meta data.

Message received

Messages that are received by the client are in the same format as the ones being sent.

Simple response

{
  "type": "message.received",
  "payload": {
    "threadId": "31ea9df73ca74dfe9329bf68c09b61ce",
    "messages": [
      {
        "fallback": "Hi, how can i help you? 🤖",
        "silent": false,
        "replyTo": "hi",
        "actions": [],
        "responses": [{
          "type": "text",
          "payload": {
            "text": "Hello 🤖, what would you like to know about flow.ai"
          }
        }],
        "intents": [
          "bot-greetings"
        ],
        "params": {},
        "contexts": [
          "morning"
        ]
      }
    ],
    "originator": {
      "userId": "c988bae9-e07d-4da2-be58-dff97a99d972",
      "name": "API.ai",
      "role": "bot",
      "profile": {
        "locale": "en-US",
        "timezone": "W. Europe Standard Time",
        "picture": "https://flow.ai/img/brains/apiai.svg"
      }
    }
  }
}

Advanced responses

Messages can contain metadata that provides additional parameters with a message.

{
  "type": "message.received",
  "payload": {
    "threadId": "31ea9df73ca74dfe9329bf68c09b61ce",
    "messages": [
      {
        "fallback": "Hi, how can i help you? 🤖",
        "silent": false,
        "replyTo": "hi",
        "actions": [

        ],
        "responses": [{
          "type": "text",
          "payload": {
            "text": "Hello 🤖, what would you like to know about flow.ai"
          }
        },
        {
          "type": "card",
          "payload": {
            "title": "What would you like to know?",
            "buttons": [
              {
                "label": "Schedule a demo",
                "type": "url",
                "value": "https://calendly.com/flowai/demo"
              },
              {
                "label": "Contact flow.ai",
                "type": "postback",
                "value": "I want to contact flow.ai"
              },
              {
                "label": "About flow.ai",
                "type": "postback",
                "value": "More information about flow.ai"
              }
            ]
          }
        },{
          "type": "card",
          "payload": {
            "title": "Here are some buttons",
            "buttons": [
              {
                "label": "Lights on",
                "type": "postback",
                "value": "Lights on"
              },
              {
                "label": "Lights off",
                "type": "postback",
                "value": "Lights off"
              },
              {
                "label": "Website url",
                "type": "url",
                "value": "http://google.com"
              }
            ]
          }
        }],
        "intents": [
          "bot-greetings"
        ],
        "params": {
        },
        "contexts": [
          "morning"
        ]
      }
    ],
    "originator": {
      "userId": "c988bae9-e07d-4da2-be58-dff97a99d972",
      "name": "API.ai",
      "role": "bot",
      "profile": {
        "locale": "en-US",
        "timezone": "W. Europe Standard Time",
        "picture": "https://flow.ai/img/brains/apiai.svg"
      }
    }
  }
}

results matching ""

    No results matching ""