Hi,
I've been able to make a webhook that calls my own nodejs api where i maintain a database of faux employees. The API responds, and I have been able to populate the Agent's response in the fulfillmentResponse Object. I've tried formatting the sessionInfo Object in a number of ways and can't update system parameters like @sys.last-name (Note: I also tried "@sys.last-name" as the parameters key, but it didn't work)? Is there something wrong w/ my JSON formatting? Here's my JSON formatting, and the console.log of what the app sent:
// Return a successful response
let jsonResponse = {
"fulfillmentResponse":{
"messages": [
{
"text": [message]
}
],
},
"sessionInfo" :{
"parameters": {
"last-name" : result[0].lastName,
"location" : "Miami",
}
}
}
res.status(200).send(jsonResponse);
console.log(JSON.stringify(jsonResponse));
----------------------------------console.log output----------------
{"fulfillmentResponse":
{"messages":[
{"text":[
"This is a copy of the employee record I was able to find in my database: \n
\nName: Charlie Brown\nPhone: 7045555551\nLocation: Anderson\nEmployee ID:
7\nEmail: cbrown@elux.com\nAddress: 1770 James Street Charlotte NC
28277\n\nSupervisor: Snoopy"
]
}
]
},
"sessionInfo":{
"parameters":{
"last-name":"Brown","location":"Miami"
}
}
}
Just to confirm, you are using Dialogflow CX? Can you provide a sample code on your webhook that can be used to reproduce the issue? Can you try separating the `sessionInfo` object with the `fulfillmentResponse` object just to check if it has the same behavior?