Originator and Profile objects
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
| Parameter | Description | Type |
|---|---|---|
| name | The originator’s name | string |
| role | The user’s role. This can either be external or moderator | string |
| profile | The optional profile information | profile object |
| metadata | Additional information in key-value pairs | object |
Profile object Parameters
An originator parameter can also contain additional profile information with the profile object.
| Parameter | Description | Type |
|---|---|---|
| fullName | A complete name | string |
| firstName | First name | string |
| lastName | Family name | string |
| gender | A person’s gender. The values are M, F, or U | string |
| locale | Locale code (ISO) | string |
| timezone | Number of hours in UTC | number |
| country | Two-letter country code | string |
| Email address | string | |
| picture | The profile picture URL | string |
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"
}
}
}
}Updated 20 days ago