Has anyone integrated api.ai bot with Gupshup.io?

507 views Asked by At

I have deployed my api.ai bot with gupshup.io platform but the problem i am facing is that when i send a message through gupshup.io and check its response on heroku server, it sets all my parameter (which were supposed to be saved in context) as null.

While when i send the same message on api.ai, it works well (saves the values of variable in context).

I am unable to understand that why on gupshup.io, the api.ai bot is unable to send values of the variables during conversation.

2

There are 2 answers

0
Shreyans On

Are you using the API.ai template on Gupshup.io? If yes, then this could be a problem due to the session ID which is unique for every message from the user. Hence every message is treated as a new message by api.ai

Check out the solution here in another thread - Maintaining session in Gupshup bot calls to Api.ai

Do let me know if this helps.

0
legendaryace On

it took me a bit to figure it out too but the trick is to have a unique ID but one which isn't unique all the time. In other words, there is 1 variable that is unique and at the same time never changes per user -> phone number.

You can use the phone number that is being passed (or sender id) and that will create unique sessions and at the same time, it will keep them persistent with the same person (so you don't lose context).