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
Mohamed HemedaMohamed Hemeda 

We are getting the following error where authenticating user with curl: {"error":"unsupported_grant_type","error_description":"grant type not supported"}

We are trying to integrate salesforce api in our php code. While authenticating we are passing following data using curl

Post Parameters= Array ( [grant_type] => password [client_id] => xxxxxx[client_secrect] => xxxxx[username] => info@domain.com [password] => xxxxx)

End Points:  https://login.salesforce.com/services/oauth2/token

Once we are calling then we getting the following response: {"error":"unsupported_grant_type","error_description":"grant type not supported"}

Please help us to fix this problem. 
ProlayProlay
Check the settings of your connected app. Make sure you have granted proper Selected OAuth Scopes.
Mohamed HemedaMohamed Hemeda
I checked and I have allowed all the proper privileges for this account , and still receiving the same error
v varaprasadv varaprasad
Hi Mohammed,

Please check below URLs: 


http://salesforceprasad.blogspot.com/2017/04/how-to-test-salesforce-rest-api.html
https://sfdcbeginner.com/how-to-test-salesforce-rest-api-using-rest-client.html


Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Thanks
Varaprasad
@For  Support: varaprasad4sfdc@gmail.com
 
Mohamed HemedaMohamed Hemeda
Thank you for the links I tested the tools too but I get the following error  {
    "error": "invalid_client",
    "error_description": "invalid client credentials"
} I know I have the correct information