help me out to go forward in salesforce integration with java using REST API.
These are the steps i came across and unable to find the way.
- Post a request to login.salesforce.com through REST client using my client_id and client_secret and username and password along with user's security token.
https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id{}&client_secret={}&username={}&password={}{}
I got the response from salesforce along with access_token as follows :
{
id: "https://login.salesforce.com/id/{}"
issued_at: "{}"
token_type: "Bearer"
instance_url: "{}"
signature: "{}"
access_token: "{}"
}
- Till now i am getting proper response. Now i am using the curl operation to get the available objects with the instance_url and access_token.
curl https://{}.salesforce.com/services/data/v31.0/ -H "Authorization: Bearer {access_token}"
Here i am getting the response as follows :
[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
Same response getting for different versions and for different instance_url.
Can you please shed some light on this issue and help me???