Learn about messages replies used with the Flow Socket API.

Messages that are replies are in almost the same format as the ones that are sent.

Payload fields

Parameter

Description

Type

threadId

Required. Unique key identifying a user or channel

string

messages

List of Message templates

array

originator

Similar to the originator when sending messages

object

Response fields

Parameter

Description

Type

fallback

Speech representation of the message

string

silent

True if message does not have any output for a user

boolean

replyTo

Optionally contains the text the message is a direct reply to

string

originator

Originator specific to this message

object

actions

Optional action names being called

array

responses

Collection of Response templates

array

flow

Information about the flow being matched

object

step

Information about the step being matched

object

params

Hash table with Parameters

object

See our complete reference of the JSON responses in Github.

{
  "type": "message.received",
  "payload": {
    "threadId": "EXAMPLE8917250d54bcbb596",
    "messages": [
      {
        "fallback": "hallo",
        "responses": [
          {
            "type": "text",
            "payload": {
              "text": "hallo"
            }
          }
        ]
      }
    ],
    "originator": {
      "userId": "USERID4bcbb59657a8a2a891",
      "name": "USER NAME",
      "role": "user",
      "profile": {
        "fullName": "USER NAME",
        "firstName": "USER",
        "lastName": "NAME",
        "locale": "nl",
        "gender": "M",
        "picture": "https://flowai.domain.com/identities/profile/EXAMPLE-318a-4d58-b5e1-b430934b8e23"
      }
    }
  }
}
{
  "type": "message.received",
  "payload": {
    "threadId": "EXAMPLE327348ed3bd1439e7b",
    "messages": [
      {
        "fallback": "Hi, how can we help?",
        "silent": false,
        "replyTo": "event attachment",
        "originator": {
          "userId": "flowai|system",
          "name": "system",
          "role": "bot",
          "profile": {
            "picture": "https://flow.ai/img/EXAMPLE/flowai.svg"
          }
        },
        "actions": [],
        "responses": [
          {
            "type": "text",
            "payload": {
              "text": "Hi, how can we help?",
              "quickReplies": [
                {
                  "label": "Chat with flow.ai",
                  "value": "Chat with someone from flow.ai",
                  "type": "text"
                },
                {
                  "label": "Call flow.ai",
                  "value": "What is your phone number?",
                  "type": "text"
                },
                {
                  "label": "Ask a question",
                  "value": "I want to ask a question",
                  "type": "text"
                }
              ]
            },
            "delay": 0
          }
        ],
        "flow": {
          "flowId": "EXAMPLE-9335-4e74-abb3-5745d26707f7",
          "title": "Intro"
        },
        "step": {
          "stepId": "EXAMPLE-e526-4252-b70c-e6e5af3338e0",
          "title": "INTRO",
          "type": "EVENT"
        },
        "params": {
          "event": [
            {
              "type": "custom",
              "value": {
                "name": "INTRO"
              }
            }
          ]
        }
      }
    ],
    "originator": {
      "userId": "flowai|system",
      "name": "system",
      "role": "bot",
      "profile": {
        "picture": "https://flow.ai/img/EXAMPLE/flowai.svg"
      }
    }
  }
}