You need to sign in to do that
Don't have an account?
Rajat Mahajan 33
Access Token Not Retrieved - Getting unsupported_grant_type error on POSTMAN and Advanced REST Client of Chrome - Please
I am trying to perform a basic step (this works when i write an apex class and then try to get the access token, but does not when i do the same from google chrome extensions)
Please see the details:
I am hitting the URL :
And i am giving these as headers:
grant_type: password
client_id: 3MVG9Y6d_Btp4xp6.aP2dpK_QvKPMy.wCLzvqeElabZryrMYgZfEyCCMVUg5fm.6SqUW5525mr3xgXNStu2IM
client_secret: 7269476387055204688
username: --------@gmail.com
password: --------
Accept: application/json
Still getting the error:
{
"error": "unsupported_grant_type",
"error_description": "grant type not supported"
}
I tried adding the Content-Type parameter as well, but does not work.
Kindly help!
Regards
Rajat
Please see the details:
I am hitting the URL :
And i am giving these as headers:
grant_type: password
client_id: 3MVG9Y6d_Btp4xp6.aP2dpK_QvKPMy.wCLzvqeElabZryrMYgZfEyCCMVUg5fm.6SqUW5525mr3xgXNStu2IM
client_secret: 7269476387055204688
username: --------@gmail.com
password: --------
Accept: application/json
Still getting the error:
{
"error": "unsupported_grant_type",
"error_description": "grant type not supported"
}
I tried adding the Content-Type parameter as well, but does not work.
Kindly help!
Regards
Rajat
https://ap1.salesforce.com/services/oauth2/token
application/x-www-form-urlencoded
Thanks,
Vinoth
As already indicated, i tried to put the Content-Type
but this does not work in POSTman or Adv REST Client.
All this works if i go throug apex code
:(
Please help
I could see that in the header you provided ,
Accept: application/json
Please change it from application/json into application/x-www-form-urlencoded to get the token.
Thanks,
Vinoth
This is strange as i provide the same from apex class and it works.
One additional parameter that i provide in apex class is Authorization : 'Basic Blob value of username and password'
But its nowhere written to provide that in POSTMAN so never used.
Please help
Regards
Rajat Mahajan
You need to ensure that the user you are trying to connect with have an access to this connected app. Please check the profile of a user and see if this connected app is checked there.
Hope this solves your issue.
Regards,
Balwinder
One reason can be your security token. You have to use your salesforce password+ security token in the place of password.
You can recheck the all speps in the below link:-
link :- https://www.appseconnect.com/how-to-connect-salesforce-and-postman-using-rest-api/
In case you find any other issue please mention.
If you find your Solution than mark as this as a best answer.
Thanks and Regards
Suraj Tripathi.