1

When I use the command

curl https://(instance).salesforce.com/services/data/v26.0/sobjects/ -H "Authorization:Bearer ############"

I get the following returned:

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

What do I need to do for this command to work?

1 Answer 1

1

You need to add Bearer in single code instead of double quote as shown below

curl https://yourinstnace.salesforce.com/services/data/v26.0/sobjects/ -H 'Authorization:Bearer 00D50000000IjCR!AR0AQLUmKfOYh5x5xEvHFZEMBqNEwakBGADwT0EFb_0Ck35r0MufEs'

When running the cURL examples for the REST resources, you may get an error on Mac and Linux systems due to the presence of the exclamation mark special character in the session ID argument.

Make sure you don't have any Escape the exclamation mark (!) special character in the session ID by inserting a backslash before it (!) when the session ID is enclosed within double quotes.

You must log in to answer this question.

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