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
Aleksander IgoshinAleksander 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
User-added imageAny ideas?
 
VinayVinay (Salesforce Developers) 
Please note that Questions about how to pass Trailhead challenges are not on topic, because these challenges are intended to be independent demonstrations of your abilities.

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,
Caleb Kuester 44Caleb Kuester 44
@Vinay I actually didn't know that this was part of a trailhead challenge, but it's not an unreasonable question to ask.

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?"
Jarrell Dunson 12Jarrell Dunson 12
Hey, I'm having the same issue... and same question:  if it prohibited, why does the Trailhead use it in the example;  curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=<your_consumer_key>" -d "client_secret=<your_consumer_secret>" -d "username=<your_username>" -d "password=<your_password_and_security_token>" -H "X-PrettyPrint:
Jarrell Dunson 12Jarrell Dunson 12
also, for the https://developer.salesforce.com/docs/atlas.en-us.224.0.chatterapi.meta/chatterapi/CR_quickstart_oauth.htm
FYI, the "Access and manage your Chatter feed" was not listed
Jarrell Dunson 12Jarrell Dunson 12
hey - I also noted that...when using PowerShell, I got the error ... now, I'm using a Windows Command window, and it runs... (though, now I have another issue...)
Prasanth AbrahamPrasanth Abraham

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