I'm new to Force.com and am working thru the REST API Dev Guide.

I've created a dev. edition org and am able to authenticate via both cURL and Postman on a Mac.

I use the auth token from the auth call in the call below:

curl https://na17.salesforce.com/services/data/v31.0/ -H 'Authorization: Bearer 00Do0000000bkyb!AQwAQImpiwZqzCPymjJmqXIMPrpfUHbgWB77l1Z79T0hC2pRfBmQ0SeDkFB3vdFCDr_xxxxxxxxxxxxxxxxxxxxxxxx'

Where "na17" is from the instance URL and the xxxxxxxxxxx was added just for this post.

And I get:

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I'm expecting so sort of newbie issue here and would appreciate an insight on what the issue may be.


2 Answers 2


You have an additional space in your call

Authorization: Bearer



So the call should look like this:

curl https://na17.salesforce.com/services/data/v31.0/ -H 'Authorization:Bearer 00Do0000000bkyb!AQwAQImpiwZqzCPymjJmqXIMPrpfUHbgWB77l1Z79T0hC2pRfBmQ0SeDkFB3vdFCDr_xxxxxxxxxxxxxxxxxxxxxxxx'

  • I've always used a space there, without error.
    – sfdcfox
    Commented Oct 8, 2014 at 1:13
  • I curled with the space and it caused the same error message. I curled without it I got the appropriate response. Not sure if this fixed @JayDee error
    – GrayB
    Commented Oct 8, 2014 at 18:08

You have to add Additional Space after Bearer, means give space between "Bearer" and "AccessToken"[00Do0000000bkyb!AQwAQImpiwZqzCPymjJmqXIMPrpfUHbgWB77l1Z79T0hC2pRfBmQ0SeDkFB3vdFCDr_xxxxxxxxxxxxxxxxxxxxxxxx]. Hopefully it will work.

Thanks, Ganesh M.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .