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

Invalid Session Id : INVALID_SESSION_ID error



I am using curl tool to test the REST API calls and used the following steps:


1. Get Access token 

curl -d "grant_type=password" -d "client_id=xxxxx" -d "client_secret=yyy" -d "username=<SFDC username>" -d "password=<password>+<security token>"


2. Received the following security token

"access_token": "zzzzzzz",
"id": "",
"instance_url": "",
"issued_at": "1352117575555",
"signature": "ocuTdQyKqBg84ga/1/MGvuwNnUfFBdQBpfwA//dwVwY="


3. curl -v -H "Authorization: OAuth zzzzzz"


I have received the following error: 

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


I have looked into the Solutions provided in this forum for this error. But none of them helped me. I am using a Java application using REST and it is working fine for the same SFDC developer account.