function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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