Originator and Profile objects

Learn about the Originator and Profile objects used by the Flow Socket API to include information about the sender of a message

In each message, you can customize details about the sender, also known as the originator of the message in Flow terminology. To add more profile information to the originator, use the Profile object.

The following is an example of an originator object:

{
  "type": "message.send",
  "payload": {
    "threadId": "EXAMPLE27348ed3bd1439e7b",
    "traceId": 1111111111111,
    "nonce": "SECRET",
    "speech": "Turn off the lights in the Living room",
    "originator": {
      "name": "John Doe",
      "role": "external"
    },
  }
}

Originator Parameters

ParameterDescriptionType
nameThe originator’s namestring
roleThe user’s role. This can either be external or moderatorstring
profileThe optional profile informationprofile object
metadataAdditional information in key-value pairsobject

Profile object Parameters

An originator parameter can also contain additional profile information with the profile object.

ParameterDescriptionType
fullNameA complete namestring
firstNameFirst namestring
lastNameFamily namestring
genderA person’s gender. The values are M, F, or Ustring
localeLocale code (ISO)string
timezoneNumber of hours in UTCnumber
countryTwo-letter country codestring
emailEmail addressstring
pictureThe profile picture URLstring

Profile object examples

The following example has information to send about expired milk.

{
  "type": "message.send",
  "payload": {
    "threadId": "EXAMPLE27348ed3bd1439e7b",
    "traceId": 1111111111111,
    "speech": "has my milk expired?",
    "originator": {
      "name": "John Doe",
      "role": "external",
      "profile": {
        "fullName": "John Doe",
        "firstName": "John",
        "lastName": "Doe",
        "gender": "M",
        "locale": "en-US",
        "timezone": -5,
        "country": "us",
        "email": "[email protected]",
        "picture": "https://..."
      }
    }
  }
}

The following example is a request to book a flight between Amsterdam and Toronto

{
  "type": "message.send",
  "payload": {
    "threadId": "EXAMPLE27348ed3bd1439e7b",
    "speech": "I want to book a flight between Amsterdam and Toronto",
    "originator": {
      "name": "John Doe",
      "role": "external",
      "metadata": {
        "clientNumber": "asddaasq333ee332",
        "preference": "A,B,G"
      }
    }
  }
}