Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialogflow with user-specific data

Currently I'm using Dialogflow to handle messages from user in a LINE application.
I planned to integrate Dialogflow with custom back-end fulfillment.
The fulfillment should have a database for some user-specific messages (e.g. each user's attributes).

Is there any way to do that in Dialogflow?

like image 497
Sirawit 'Plum' P. Avatar asked Sep 09 '26 13:09

Sirawit 'Plum' P.


2 Answers

Note two things about the solution you figured out:

  1. It is platform specific - everything under originalDetectIntentRequest.playload comes from the platform that is making the request.

  2. If you're using the Actions on Google platform, the userId field has been deprecated and will be removed in May 2019.

If you're using Actions on Google, you have a few solutions.

The most straightforward replacement is to use the userStorage facility provided by Actions on Google. In the most simple case, you can just store the information you want to remember about the user here. If you want or need to use a database instead, then you can generate your own userId for the user and store it in userStorage the first time they visit, and retrieve it from there on subsequent visits.

More complicated, but which adds additional features, is to use Account Linking to associate their connection with another account your system uses, such as Google Sign In.

like image 58
Prisoner Avatar answered Sep 11 '26 03:09

Prisoner


Ok, I figured it out.
It's originalDetectIntentRequest.payload.data.source.userId

like image 31
Sirawit 'Plum' P. Avatar answered Sep 11 '26 02:09

Sirawit 'Plum' P.