Hello,
In order to use the built-in script variables related to chat in a Script, the Genesys Desktop UI & Script with Guest Chat (Chat v2) expect the different information (firstName, lastName, phoneNumber, ...) to be part of the Conversation's Participant data/attributes.
Because of this, these fields must all be sent via the memberInfo.customFields.
I mean the request would have to be like this:
{
"organizationId": "xxx",
"deploymentId": "yyyy",
"routingTarget": {
"targetType": "queue",
"targetAddress": "Marketing"
},
"memberInfo": {
"displayName": "Joe Dirt",
"avatarImageUrl": "http://some-url.com/JoeDirtsFace",
"customFields": {
"lastName": "Joe",
"firstName": "Dirt",
"email": "joe.dirt@example.com",
"phoneNumber": "+12223334444",
"Subject": "arbitrary data",
"another_field": "more arbitrary data"
}
}
}
or this should work as well:
{
"organizationId": "xxxx",
"deploymentId": "yyyy",
"routingTarget": {
"targetType": "queue",
"targetAddress": "Marketing"
},
"memberInfo": {
"displayName": "Joe Dirt",
"avatarImageUrl": "http://some-url.com/JoeDirtsFace",
"lastName": "Joe",
"firstName": "Dirt",
"email": "joe.dirt@example.com",
"phoneNumber": "+12223334444",
"customFields": {
"lastName": "Joe",
"firstName": "Dirt",
"email": "joe.dirt@example.com",
"phoneNumber": "+12223334444",
"Subject": "arbitrary data",
"another_field": "more arbitrary data"
}
}
}
The mapping between the attribute name (in the Guest Chat request - under memberInfo.customFields) and the Script built-in variables is:
Guest Chat: memberInfo.customFields.lastName
Script: {{Chat.Customer Last Name}}
Guest Chat: memberInfo.customFields.addressStreet
Script: {{Chat.Customer Street}}
Guest Chat: memberInfo.customFields.addressCity
Script: {{Chat.Customer City}}
Guest Chat: memberInfo.customFields.addressPostalCode
Script: {{Chat.Customer Postal Code}}
Guest Chat: memberInfo.customFields.addressState
Script: {{Chat.Customer State}}
Guest Chat: memberInfo.customFields.phoneNumber
Script: {{Chat.Customer Phone Number}}
Guest Chat: memberInfo.customFields.phoneType
Script: {{Chat.Customer Phone Type}}
Guest Chat: memberInfo.customFields.customerId
Script: {{Chat.Customer ID}}
There is one Chat Script built-in variable which is not working with Guest Chat/Chat v2.
Script - Not working with Chat v2: {{Chat.Customer Email}}
You can retrieve the value of the customer email and expose it using a different method.
This method is also the one to use for any custom field/attribute (like "Subject" and "another_field" you have shown in your sample request).
You can define/add a variable in your script (Type String):
With Name = the name of the custom field on Guest Chat API side (ex: email, Subject, another_field),
And with the "Input" toggle enabled (i.e. Input = Yes)
You can then display the content of the variable in a Text component using {{email}}, {{Subject}}, {{another_field}}
See this post for more information.
Regards,