You need to sign in to do that
Don't have an account?
Aleksander Igoshin
curl. Invoke-WebRequest : Cannot bind parameter because parameter 'd' is specified more than once.
Greetings colleagues!
I am having trouble running a command line query using curl as described in the "Apex Web Services" trailhead module.
My query is:
curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9SOw8KERNN09ehk9tCIoYp.aYCp_xA94091vWwHwZAD7lHVP6MqAVGbtQbrlKeq2Rp1fyT6x1uw33vjGy" -d "client_secret=6E0E87676A134C0CB0DA749BABB418C83DC85D11D0C9CD5B9DFE7ABFE4758D55" -d "username=a.igoshin@playful-otter-w2zsim.com" -d "password=alex12345678cFTM2sASCDbggLg4iIc88nO" -H 'X-PrettyPrint:1'
The answer is
Any ideas?
I am having trouble running a command line query using curl as described in the "Apex Web Services" trailhead module.
My query is:
curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9SOw8KERNN09ehk9tCIoYp.aYCp_xA94091vWwHwZAD7lHVP6MqAVGbtQbrlKeq2Rp1fyT6x1uw33vjGy" -d "client_secret=6E0E87676A134C0CB0DA749BABB418C83DC85D11D0C9CD5B9DFE7ABFE4758D55" -d "username=a.igoshin@playful-otter-w2zsim.com" -d "password=alex12345678cFTM2sASCDbggLg4iIc88nO" -H 'X-PrettyPrint:1'
The answer is
Any ideas?
Trailhead Help (https://trailhead.salesforce.com/en/help?support=home)can provide assistance for situations where Trailhead does not appear to be functioning correctly. You can reach out to them if this is the case.
Please close the thread by selected as Best Answer so that we can keep our community clean
Thanks,
If you go to the URL:
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_oauth.htm
-- it gives you a plug-and-play curl command that returns this error.
For someone who is not intimately familiar with the use of curl, one might ask "if it is a requirement to not use -d more than once, why are they using it more than once in an example?"
FYI, the "Access and manage your Chatter feed" was not listed
Powershell uses curl as an alias for Invoke-WebRequest and not proper curl - which is why it does not like multiple d parameters.
Work around, use cmd, or gitbash or wsl or practically anything other than powershell.
Ref: https://stackoverflow.com/a/48495916/2382447