You need to sign in to do that
Don't have an account?
Bhanu joshi 10
How to get user session id , while making a callout using batch class?
I am calling a class that is using tooling API to update validation rule from BATCH CLASS.
I am getting user session id as null.
req.setHeader('Authorization','Bearer '+UserInfo.getSessionID()); // here iam getting null
req.setHeader('Content-Type', 'application/json');
req.setHeader('Content-Length', '0');
and when i run class from developer console , all works fine.
Please let me know how to fix this ?
Thanks
I am getting user session id as null.
req.setHeader('Authorization','Bearer '+UserInfo.getSessionID()); // here iam getting null
req.setHeader('Content-Type', 'application/json');
req.setHeader('Content-Length', '0');
and when i run class from developer console , all works fine.
Please let me know how to fix this ?
Thanks
yes it has stoped to pront in debug,
but how to get session id if i want to make a http callout from batch Class
req.setHeader('Authorization','Bearer '+UserInfo.getSessionID());
hope this solve your problem . if it worked plz marked as a solved