I’m trying to integrate Dialogflow ES into my website Chat portal (live helper chat).
i use REST API to pass user input to the DialogFlow system.
is there any way to pass the user’s name and other details that are already available on my website when the user starts chatting with the DialogFlow system? Then user doesn’t need to tell the name and other details to dialogFlow. the system will pass the details when the user starts to chat.
Here is my request Body that sent to DialogFlow API
{
"queryInput": {
"text": {
"text": "'.$text.'",
"language_code": "en-US"
},
},
"queryParams": {
"payload": {
"name": "John",
"CRN": "1234"
}
}
}
I pass user input (Hello) through $text variable
this is my Default welcome Intent on DialogFlow
this is the response when i pass name and CRN through queryParams
{
"responseId": "31d44f03",
"queryResult": {
"queryText": "Hello",
"action": "input.welcome",
"parameters": {
"name": "",
"CRN": ""
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Hi! I'm JLanka AI bot. How are you doing?",
"fulfillmentMessages": [
{
"text": {
"text": [
"Hi! I'm AI bot. How are you doing?"
]
}
}
],
"outputContexts": [
{
"name": "projects/chat-bot/agent/sessions/112345677778111895/contexts/getnameandcrn",
"lifespanCount": 5,
"parameters": {
"name.original": "",
"CRN": "",
"CRN.original": "",
"name": ""
}
}
],
"intent": {
"name": "projects/chat-bot/agent/intents/aee19f2f",
"displayName": "Default Welcome Intent"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
but when user says “hello im Jhone.my crn is 1234”
{
"responseId": "46cfd1da",
"queryResult": {
"queryText": "hello im Jhone.my crn is 1234",
"action": "input.welcome",
"parameters": {
"name": {
"name": "Jhone"
},
"CRN": "1234"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Good day Jhone! I'm AI bot. What can I do for you today?",
"fulfillmentMessages": [
{
"text": {
"text": [
"Good day Jhone! I'm AI bot. What can I do for you today?"
]
}
}
],
"outputContexts": [
{
"name": "projects/jlt-chat-bot/agent/sessions/112345677778111895/contexts/getnameandcrn",
"lifespanCount": 5,
"parameters": {
"CRN": "1234",
"name": {
"name.original": "Jhone",
"name": "Jhone"
},
"name.original": "Jhone",
"CRN.original": "1234"
}
}
],
"intent": {
"name": "projects/jlt-chat-bot/agent/intents/aee19f2f",
"displayName": "Default Welcome Intent"
},
"intentDetectionConfidence": 0.9038154,
"languageCode": "en"
}
}
What am I doing wrong? Can you guys help me to sort out this issue?