简体   繁体   中英

Is there a way to dynamically generate sessionid for a request in api.ai

i have a nodejs rest api that hits api.ai wit a query. I want to generate a unique session ID for each user who accesses the app.

If I use the same session ID for all the requests I am afraid that the data(entities) of one request will be used for another request as the session ID is same.

So is there any way by which i can obtain an access troken from an agent in api.ai

To just generate unique ids, there is some packages in npm implementing that in various ways, like uuid .

But for everything related to the separation of session data, I suggest that you dig into the details of the web server, they usually provide a way to separately handle request and sessions.

EDIT : For example, if your using express server, a session id is present in every request at req.sessionID

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM