samtecspg / articulate

A platform for building conversational interfaces with intelligent agents (chatbots)
http://spg.ai/projects/articulate/
Apache License 2.0
599 stars 159 forks source link

How to retrieve session id from CSO in webhook. #974

Closed rounakraj closed 4 years ago

rounakraj commented 4 years ago

Hi @wrathagom , I have a question on how to retrieve the unique session id from CSO in webhook. I would like to identify the session to a unique user.

Thanks, Rounak

wrathagom commented 4 years ago

You can view the entire CSO by doing something like this in your webhook {{{JSONstringify .}}}. I haven't tried it in a while, but I thought the sessionId was a top level key so it would be just {{sessionId}}. @dakavisa or @dcalvom can you verify?

rounakraj commented 4 years ago

Thanks @wrathagom I could retrieve the sessionID from CSO. I would like to hear your suggestion on building account_linking like feature present in google and Alexa with articulate chatbot. As we are controlling smart home each home will be linked to a unique user, what is the best way to achieve and retain this linking.

Would love to hear your views.

rounakraj commented 4 years ago

@wrathagom Would love to hear your opinion on this.

wrathagom commented 4 years ago

You will need to build some sort of an authentication flow in the app for a user to identify themselves (receive a text/click on a link/etc) this will allow you to tie that connection (Facebook, text, etc) to a single user. Then from there everything can be personalized to them. You can set a saved Slot to the ID and name of the user and set it to be saved for forever, or even require re-auth after 100 conversation turns, etc.

We will eventually get around to building in user linking, or at least it is something on our roadmap.