Missing or duplicate parameters


#1

When I m trying to get the session, always seems to return this error:

{
“error”: “invalid_request”,
“error_description”: “Missing or duplicate parameters”
}

My request are exactly as the documentation says:

https://#API_KEY:#SHARED_SECRET@api.transport.nsw.gov.au/auth/oauth/v2/token?grant_type=client_credentials&scope=user

Anyone knows whats wrong??

Thanks in advance!!!


#2

Morning this works for me

url -X POST "https://xxxxxxxxxxxx:xxxxxxxxxxxx@api.transport.nsw.gov.au/auth/oauth/v2/token?grant_type=client_credentials&scope=user"

it returns

{ "access_token":"xxxx-xxxx-xxxx-xxxx-xxxx", "token_type":"Bearer", "expires_in":3600, "scope":"user" }

However if I do

url -X POST "https://xxxxxxxxxxxx:xxxxxxxxxxxx@api.transport.nsw.gov.au/auth/oauth/v2/token?grant_type=client_credentials&scope=user" --data "grant_type=client_credentials&scope=user"

Then I get the same error message.

{ "error":"invalid_request", "error_description":"Missing or duplicate parameters" }

TLDR; check to see that you are not posting your Parameters twice, once in the URI and once in the POST Body.