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

ParameterDescriptionType
threadIdRequired. Unique key identifying a user or channelstring
messagesList of Message templatesarray
originatorSimilar to the originator when sending messagesobject

Response fields

ParameterDescriptionType
fallbackSpeech representation of the messagestring
silentTrue if message does not have any output for a userboolean
replyToOptionally contains the text the message is a direct reply tostring
originatorOriginator specific to this messageobject
actionsOptional action names being calledarray
responsesCollection of Response templatesarray
flowInformation about the flow being matchedobject
stepInformation about the step being matchedobject
paramsHash table with Parametersobject

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"
      }
    }
  }
}