Session ID as a flow Variable

I am trying to find a way to get the session ID as a flow variable or global variable.

During the Chat session, I need to collect the session ID and store it as a variable. The Variable will be used to send an API to a third party system to be used later to Link the Chatbot Session Data, with the third party data.

I found resources that show how to Query the Session Properties, but i need this to happen During that session.


You can use the getSessionId method. As the session ID won’t change during the session, you can add this code in the Global > Scripts > Begin dialog:
yourVariable = _.getSessionId()


I tried the .getSessionID() method and couldnt get it to work. I did however, find that the session ID was being stored in session storage on the website, so i wrote some code to pass that along to chatbot!

looks like both of these methods would work in the end!

I have tried the following scripts and none seem to work out:

sSessionIDFC =_.getSessionId()
sSessionIDFC = engineEnvironment.getSessionId()
sSessionIFFC = engineAccess.getSessionId()

any insight?

Hmm its wierd. Where do you put these scripts? According to the documentation both _.getSessionId() and engineAccess.getSessionId() should work.

I was able to get this to work - thank you!

I think i had a syntax error in it before!