+ Start a Discussion
K SrikanthK Srikanth 

Can we get admin user session id in apex

Hello,

Can we get admin user session id in apex?
CharuDuttCharuDutt
Hii k Srikanth
Try Below Code
System.debug(URL.getSalesforceBaseUrl().toExternalForm());
System.debug(UserInfo.getOrganizationId());
System.debug(UserInfo.getSessionId().substring(15));
Please Mark It As Best Answer If It Helps
Thank You!

 
K SrikanthK Srikanth

Hi CharuDutt,

I need admin user session id, not loggedin user session id.

Thankyou