mehul
(Mehul B)
November 4, 2020, 5:13am
1
Hi,
I want to pass user location from C# API to kore.ai API along with question text.
Currently I am following below steps,
Generate a token
Call the API - chatbot/hooks/st-XXXXXXXXXXXXX & pass the payload as below.
{ “message”: {
“text”: “Get weather today” },
“from”: {
“id”: “XXXXXXXXXXXXXXXXXXXXXX”,
“userInfo”: {
“firstName”: “ABC User”,
“lastName”:“ABC Last Name”,
“email":"e@e.com ”
}},
“mergeIdentity” :true
}
How can I pass customData in this payload & receive it on kore.ai bot site? Once I have location I can call the weather service specific to that location. Currently I am getting blank value for firstName on kore.ai side.
Sample prompt message for Entity00 {{context.session.UserContext.firstName}} FFFFERERER EEEE YYY
Please help.
Thanks,
Mehul
Hi @mehul ,
You can pass the customData from webSDK and use it in the bot flow internally.
Please refer the following documentation links:
https://developer.kore.ai/docs/bots/bot-builder-tool/dialog-task/context-object/
Adding custom data at botInfo inside index.html of webSDK allows developers to pass additional information of the user accessing the channel.
The details like phone number, address or even the access token if in case the webSDK is hosted on the site which needs authorization are examples of data which can be passed inside the customData .
[image]
customData can be accessed from lastMessage under the BotUserSession of the context object.
This data will be specific to the user using webSDK and…
Let us know if you need any further clarification.
Regards,
Yoga Ramya