Not able to create AccessToken using cURL

Not applicable

I get the error highlighted below. I did try several combinations. Did anyone come across this?

C:>curl -X POST -H "Content-Type: application/x-www-form-urlencod
ed" https://myname-test.apigee.net/oauth/client_credential/accesstoken?grant_
type=client_credentials -d 'client_id=rcZ4qQ3EUqYRbGB6F&client_se
cret=9RJLkBte'
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
'client_secret' is not recognized as an internal or external command,
operable program or batch file.

0 2 729
2 REPLIES 2

Not applicable

Try the below:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d ' client_id=rcZ4qQ3EUqYRbGB6F&client_secret=9RJLkBte&grant_type=client_credentials ' "https://myname-test.apigee.net/oauth/client_credential/accesstoken"

Also, the error could be due to a incorrectly spelt hostname or the hostname is not yet tabled in your DNS. Maybe you could also try using the IP instead.

Thanks, Shree!

I tried different combination of the command but no luck.

Some of the errors are: "curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol" and/or "'client_secret' is not recognized as an internal or external command, operable program or batch file. 'grant_type' is not recognized as an internal or external command, operable program or batch file."

Spelling of host name is correct.

Added DNS entry in the host file. However, ping to myname-test.apigee.net shows request time out.

Please let me know if cURL command to generate AccessToken is working for anyone and if any extra steps are needed to configure the DNS etc..