function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ClariusClarius 

REST API Access gives INVALID_SESSION_ID as a result

Hi,

 

I know there are several posts on this subject, but none of them have solved my problem. I have successfully completed the OAUTH2 workflow and gotten an Access Token and Instance URL from the OAuth2 Redirect. I then save these two and now am trying to access data using curl, as shown below.

 

$ curl 'https://na9.salesforce.com/services/data/v20.0/' -H 'Authorization: Bearer access_token
 
I get the following as the response:
 
[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
 
The following works fine:
 
 

I have reviewed the following posts:

 

 
 
One of them mentions I need to send an email to Alex to enable API Remote Access - is that still needed?
 
Note that the Access Token is correct and is fresh (only 10 minutes old). Instance_url is also correct.
 
Thanks
 
venkat