Learn about the Originator and Profile objects used by the Flow Socket API to include information about the sender of a message
With each message, you can customize information regarding the sender, user, or as Flow calls it, the originator of the message. Use the Profile object to add additional profile information to the originator.
{
"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 fields
Parameter | Description | Type |
---|---|---|
name | Name representing the originator | string |
role | Either external or moderator | string |
profile | Optional profile type | profile object |
metadata | Key value pairs with additional info | object |
Profile object fields
An originator can contain additional profile information using the profile object.
Parameter | Description | Type |
---|---|---|
fullName | Complete name | string |
firstName | First name | string |
lastName | Family name | string |
gender | Gender, M, F or U | string |
locale | Locale code (ISO) | string |
timezone | Number of hours of UTC | number |
country | Two letter country code | string |
Email address | string | |
picture | URL to profile picture | string |
Profile object examples
{
"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://..."
}
}
}
}
{
"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"
}
}
}
}