You need to sign in to do that
Don't have an account?
An Apex Integration Services Module cURL Issue, Encountered, Have I
Into the Apex Integration Services module, happily, I began.
In the Apex Web Services unit, blissfully, I continued.
At the Retrieve Data with a Custom GET Method section, without incident, I arrived.
Into the Retrieve Data Using cURL sub-section, with rapt anticipation, I delved.
The cURL command line tool, dutifully, I installed.
My
I saved.
The
cURL command, diligently, I constructed.
A Windows command prompt, quickly, I opened.
The
error message, sadly, I encountered.
More on cURL from the Resources section, with mounting trepidation, I perused.
At a dead-end, afterward, I am.
About what has going wrong, perplexed, I wonder.
At the foot of the Salesforce masters, humbly, now, I bow.
In the Apex Web Services unit, blissfully, I continued.
At the Retrieve Data with a Custom GET Method section, without incident, I arrived.
Into the Retrieve Data Using cURL sub-section, with rapt anticipation, I delved.
The cURL command line tool, dutifully, I installed.
My
Session ID: 00D36000000KIKL, Reccord ID: 50036000003Sv7IAAS Instance: appliedconcepts-dev-ed.my
I saved.
The
'curl https://appliedconcepts-dev-ed.my.salesforce.com/services/apexrest/Cases/50036000003Sv7IAAS -H "Authorization: Bearer 00D36000000KIKL" -H "X-PrettyPrint:1"'
cURL command, diligently, I constructed.
A Windows command prompt, quickly, I opened.
The
"[ { "message" : "Session expired or invalid", "errorCode" : "INVALID_SESSION_ID" } ]"
error message, sadly, I encountered.
More on cURL from the Resources section, with mounting trepidation, I perused.
At a dead-end, afterward, I am.
About what has going wrong, perplexed, I wonder.
At the foot of the Salesforce masters, humbly, now, I bow.
You have solved my problem. Steven appears to have be the initial solver on June 12, 2016. Ryan confirned it and Sandhya pointed me to it on July 30, 2016.
The text in the Apex Integration Services module's Apex Web Services unit that suggests using the Session Id displayed in the Workbench for the cURL command, appears to be incorect, at least in my configuration. That Session Id is the short-form one, and does not work, resulting in the Invalid Session Id error. The long-form Session Id, that can be acquired by using the UserInto.getSessionId() call in, say the Developer Console's Execute Anonymous Window DOES work.
Also, the requirement mentioned in a previous post that says you must escape the exclamation point in the Session Id, is not required if you bound the Authorization string in double quotes. In any case, here is the cURL command that works ...
And here is the resulting output ...
Gentlemen, I thank you. You can see so far into the distance when you stand on the shoulders of giants! (:>) Cheers.
David
All Answers
You have an additional space in your call the code should be I got the same error, and when I removed space, I was able to get a response.
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
Thank you for your response. I 'did' remove the space character between Authorization: and Bearer, as you suggested. But, when I re-tried the command, I got the same error. Perhaps the issue is something else. By the way, I got the Session ID from the Workbench Info > Session Information > Connection > Endpoint, as instructed in the Apex Web Services Trailhead unit. To wit ...
The modified command I tried is now ...
But the error still persists ...
If you think of anything else, kindly let me know. I'm pursuing further Google research as we speak. Again, thanks,
David
You have solved my problem. Steven appears to have be the initial solver on June 12, 2016. Ryan confirned it and Sandhya pointed me to it on July 30, 2016.
The text in the Apex Integration Services module's Apex Web Services unit that suggests using the Session Id displayed in the Workbench for the cURL command, appears to be incorect, at least in my configuration. That Session Id is the short-form one, and does not work, resulting in the Invalid Session Id error. The long-form Session Id, that can be acquired by using the UserInto.getSessionId() call in, say the Developer Console's Execute Anonymous Window DOES work.
Also, the requirement mentioned in a previous post that says you must escape the exclamation point in the Session Id, is not required if you bound the Authorization string in double quotes. In any case, here is the cURL command that works ...
And here is the resulting output ...
Gentlemen, I thank you. You can see so far into the distance when you stand on the shoulders of giants! (:>) Cheers.
David