You need to sign in to do that
Don't have an account?
Abilash Kosigi 8
Requesting OAuth Token from Curl (Rest API)
Hi,
I am new to REST API. I would like to send Http Requests from Curl software that I installed on my desktop.
How to request OAuth token from command prompt using Curl.(I have done extensive search on google - could not find any reliable answer).
What is the callback URL that I should give in Salesforce dev edition.
Please help
I am new to REST API. I would like to send Http Requests from Curl software that I installed on my desktop.
How to request OAuth token from command prompt using Curl.(I have done extensive search on google - could not find any reliable answer).
What is the callback URL that I should give in Salesforce dev edition.
Please help
For the callback URL you can use something like http://test or http://localhost.
https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com#Obtaining_a_Token_in_an_Autonomous_Client_.28Username_and_Password_Flow.29
Try using the below cURL command :
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]"
It will return you the access token.
Mark it as Best Answer, if it helps you
Regards,
Grazitti Team
www.grazitti.com
I am getting the following error when I am trying cURL Command that you mentioned.
{"error":"invalid_grant","error_description":"authentication failure"}
Please help.
Also, Just make sure that you are entering proper combination of Password and Security Token.
If you still face the same issue send us the cUrl command you are hitting as well as the error genarated.
See my post here (scroll to the bottom)
https://developer.salesforce.com/forums/ForumsMain?id=906F00000009CYaIAM