1

I have one client with 3 hotels for which I want to build chat bot for making reservation and I wish to build only one single bot which handles all hotel. Somehow I want to identify at start of chat which hotel site he is coming from. How to do that ?

Pinal
  • 41
  • 8

1 Answers1

1

You must be using your own endpoint between those channels and your Lex bot, right?

That way, you can catch the exact requests sent from those channels before Lex processes the messages.

Then all you have to do to determine which Hotel the user is communicating with is to match the recipient information sent with the channel's request.

For example: (Facebook)

...
"messaging":[{
    "sender":{
        "id":"xxxxxxxxxxxxxxxx"
    },
    "recipient":{
        "id":"xxxxxxxxxxxxxxxx"
    },
    ...
}]

The sender.id is the user's facebook PSID.
The recipient.id is the facebook page ID that the user has messaged.

So if each of the 3 hotels have different facebook pages, then simply match recipient.id to that hotel. You can then pass along the hotel identification to Lex through requestAttributes or sessionAttributes.

Jay A. Little
  • 3,239
  • 2
  • 11
  • 32