You need to sign in to do that
Don't have an account?
Apex Web Services Trailhead/Module getting the SessionID for cURL
The "Apex Web Services" trailhead unit/module says to get the session id form the Workbench -> Session Information menu option in the connection folder. But I don't know if I'm doing something wrong but I don't see any session id value listed there.
So I found another simple way to get the session id to pass into cURL command line as instructed by the trailhead.
Simply copy and paste the following line into the Execute Annoymous Window of the developer console and view the log file:
System.debug('Sessionid='+UserInfo.getSessionId());
So I found another simple way to get the session id to pass into cURL command line as instructed by the trailhead.
Simply copy and paste the following line into the Execute Annoymous Window of the developer console and view the log file:
System.debug('Sessionid='+UserInfo.getSessionId());
You can find under info dropdown --> session information -- > connection
Please see below screenshot.
Hope this helps you.
Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
Thanks and Regards
Sandhya
- Use the 'long' version of the session Id obtained from a system debug of UserInfo.getSessionId() (short version obtained from workbench as in the screenshot above didn't work)
- Use single quotes in the header parameters! (same exact command failed with double quotes)
- Put the whole command on the same line (without carriage returns). I'm no cUrl expert but there seemed to be weird behaviour if this wasn't just right.
- Paste the command into your terminal and press Enter
Hope you Trailheaders find this if you're struggling with the module.Trailhead module in question: https://developer.salesforce.com/trailhead/apex_integration_services/apex_integration_webservices
So the resulting command using the long version of the session Id that worked for me was this:
It's disappointing that this issue has gone almost a year without being addressed.
The feedback link is our primary channel for accepting feedback, though we also do our best with our small team to monitor these forums, Success Community, chatter, Twitter, Facebook, and email.
I'll get your feedback assigned to the writer today. Thanks for sending in your comments.