调用Monzo Auth API获取access token时遇client_id未知错误求助
Let’s walk through the most likely issues causing this error — I’ve seen this trip up a lot of Monzo API developers, so let’s break it down:
You’re using the wrong ID entirely
TheGET /ping/whoamiendpoint returns your user account ID, not the OAuthclient_idrequired for the Auth API. You need to create a dedicated OAuth client in the Monzo Developer Console (under the "Clients" section) — that’s where you’ll get the validclient_id(and matchingclient_secret) for auth flows. This is the #1 mistake here, since the two IDs look similar but serve completely different purposes.Your parameter isn’t being passed in the correct format
Monzo’s OAuth token endpoint (POST /oauth2/token) expects parameters to be sent asapplication/x-www-form-urlencoded(form data), not JSON. If you’re wrappingclient_idin a JSON body or appending it to the URL query string, the API won’t recognize it. Here’s a correct example using curl:curl -X POST "https://api.monzo.com/oauth2/token" \ -d "client_id=your_valid_oauth_client_id" \ -d "client_secret=your_client_secret" \ -d "grant_type=authorization_code" \ -d "code=your_authorization_code" \ -d "redirect_uri=https://your-redirect-uri.com"You’ve misspelled the parameter name
Double-check that you’re using exactlyclient_id(lowercase, underscore included). Variants likeclientId,ClientID, orclient-idwill be treated as unknown parameters by the API.You’re mixing environments
If you’re testing in the Monzo Playground, make sure theclient_idyou’re using was created for the playground environment (not production). While the API base URL is often the same, mismatched environment credentials can still trigger validation errors.
Start with verifying your client_id source first — that’s almost certainly the issue if you pulled it from whoami. Once you have the correct OAuth client ID, double-check the request format and parameter spelling, and you should be good to go.
内容的提问来源于stack exchange,提问作者Wrumble

