Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Problem: trying to authenticate to a dev org using Session Id authentication and cURL fails when following the REST API Dev doc. The example in the doc provides the following, which fails (Quick Start pg:23):

curl -d "grant_type=password" -d
"client_id=myclientid" -d "client_secret=myclientsecret" -d "" -d

Even after appending the security token to the password, the response is the same:

{"error":"invalid_grant","error_description":"authentication failure"}
share|improve this question
up vote 11 down vote accepted

The documentation has a bug in it. Following the documentation, your cURL command would look like this:

curl -d "grant_type=password" -d 
"client_id=XXXXXX.YYYYY_ZZZZZ" -d "client_secret=000099990000" -d "" -d 

It's missing the username= parameter. Change it to the following and it will work for you:

curl -d "grant_type=password" -d 
"client_id=XXXXXX.YYYYY_ZZZZZ" -d "client_secret=000099990000" -d "" -d 
share|improve this answer
Good find. Are you aware you can report this directly to Salesforce? Here is the html version of the page At the bottom of the page there is the section: Was this information helpful?, and the link Yes, except. Where you can put all the details you have posted in this question and answer. I don't know how proactive they are with the feedback they receive, so it may get ignored. But it's better than nothing – Daniel Blackhall Dec 9 '12 at 22:01
The feedback form directly logs a case with the doc writer team, and is by far the best way to give feedback & get the docs improved. – superfell Dec 9 '12 at 22:04
This is good to know. Thanks. I gave up on logging cases when they changed the rules to disallow dev orgs to file them. But I'll post this on the feedback form. – Adam Dec 9 '12 at 22:10
I stubmled across this today - proof positive that the documentation hasn't been corrected in 9 months – Καrτhικ Sep 11 '13 at 19:13
Too bad. I logged this on the feedback form back when it happened. This is why the StackExchange isn't going anywhere. – Adam Sep 11 '13 at 22:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.