• Mike B 31
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I use the password flow to get the access token like this:

 

curl -k https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=[clientid]" -d "client_secret=[clientsecret]" -d "username=[myusername]" -d "password=[mypassword][mysecuritytoken]"

 

which returns

 

{"id":"https://login.salesforce.com/id/00Di0000000JgfhEAC/005i0000000dbdwAAA",
"issued_at":"1366942091291",
"instance_url":"https://na15.salesforce.com",
"signature":"yZsqE5VvYAZb+2dVw2zUNFsTllZxy9JjZBMFxYIGcAI=",
"access_token":"00D...vZ1"}

 

Then I do

 

curl -k https://na15.salesforce.com/services/data/v27.0/chatter/users/me -H 'Authorization: Bearer 00D...vZ1'

 

but I get this error response:

 

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

curl: (6) Could not resolve host: Bearer
curl: (6) Could not resolve host: 00D...vZ1'

 

Any idea of what is wrong?

 

  • April 26, 2013
  • Like
  • 0