I've noticed when using the official Postman collection, the parameters for any methods have to be put as parameters in the URL, otherwise the status code received is 400.
I've tried debugging it, so I transformed the request into a curl command for comparison. The following two examples are based on Query for User Information endpoint.
Example No. 1 returns status code 400 (parameters sent in the body):
curl --location --request GET login.salesforce.com/services/oauth2/userinfo --header 'Content-Type: application/x-www-form-urlencoded' --header 'Cookie: BrowserId=usq7aOP-Ee2-kNv2ky7zDw; CookieConsentPolicy=0:0; LSKey-c$CookieConsentPolicy=0:0' --data-urlencode 'access_token={access token}'
Error message:
{
"error": "unsupported_grant_type",
"error_description": "grant type not supported"
}
Example No. 2 is equivalent to the previous one, except the parameters are in the URL and returns 200:
curl --location --request GET login.salesforce.com/services/oauth2/userinfo?access_token={access token} --header 'Content-Type:application/json' --header 'Cookie: BrowserId=usq7aOP-Ee2-kNv2ky7zDw; CookieConsentPolicy=0:0; LSKey-c$CookieConsentPolicy=0:0'
Can anyone help me understand what is the problem here? I understand that sending the parameters in the URL is working, but since the body is in the x-www-form-urlencoded format, it would be much more secure to send the request in this format.