Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

What is the session token and how can i get it?

Tirso1
Giga Contributor

I tried to get the session token with the gs.getSession ().getSessionToken (); function, but it return Undefined value. I need the session token value to send to a webservice and validate the user session that is try comunicate and give him a access key to can comunicate.

2 REPLIES 2

Jace Benson
Mega Sage
Are you running this in a scope? My notes on it say running what you wrote should give it to you. https://blog.jacebenson.com/post/2018-05-12-g_ck/

JFL1
Tera Contributor

Hey man, it's gs.getSessionToken()